/// <summary> /// Call Marshal.FreeHGlobal in the target process. /// </summary> public static void FreeHGlobal(RemotePtr hglobal) { var call = new CfrMarshalFreeHGlobalRenderProcessCall(); call.hglobal = hglobal.ptr; call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection); }
/// <summary> /// Call Marshal.FreeHGlobal in the target process. /// </summary> public static void FreeHGlobal(RemotePtr hglobal) { var call = new CfrMarshalFreeHGlobalRemoteCall(); call.hglobal = hglobal.ptr; call.RequestExecution(hglobal.connection); }
internal static CfrSchemeRegistrar Wrap(RemotePtr remotePtr) { if (remotePtr == RemotePtr.Zero) { return(null); } return(new CfrSchemeRegistrar(remotePtr)); }
internal override sealed void OnDispose(RemotePtr remotePtr) { if (dtor != null) { dtor.nativePtr = remotePtr.ptr; dtor.RequestExecution(remotePtr.connection); } }
/// <summary> /// Initialize the command line with the specified |argc| and |argv| values. /// The first argument must be the name of the program. This function is only /// supported on non-Windows platforms. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>. /// </remarks> public void InitFromArgv(int argc, RemotePtr argv) { var call = new CfxCommandLineInitFromArgvRenderProcessCall(); call.self = CfrObject.Unwrap(this); call.argc = argc; call.argv = argv.ptr; call.RequestExecution(this); }
/// <summary> /// Creates a new object that is not owned by any other object. The specified /// |data| will be copied. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>. /// </remarks> public static CfrBinaryValue Create(RemotePtr data, int dataSize) { var call = new CfxBinaryValueCreateRenderProcessCall(); call.data = data.ptr; call.dataSize = dataSize; call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection); return(CfrBinaryValue.Wrap(call.__retval)); }
/// <summary> /// Call Marshal.PtrToStringUni in the target process. /// </summary> public static string PtrToStringUni(RemotePtr str, int length) { var call = new CfrMarshalPtrToStringUniRemoteCall(); call.str = str.ptr; call.length = length; call.RequestExecution(str.connection); return(call.__retval); }
/// <summary> /// Create a new CfrStreamReader object from data. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_stream_capi.h">cef/include/capi/cef_stream_capi.h</see>. /// </remarks> public static CfrStreamReader CreateForData(RemotePtr data, ulong size) { var call = new CfxStreamReaderCreateForDataRemoteCall(); call.data = data.ptr; call.size = size; call.RequestExecution(); return(CfrStreamReader.Wrap(new RemotePtr(call.__retval))); }
/// <summary> /// Sets the user data for this object and returns true (1) on success. Returns /// false (0) if this function is called incorrectly. This function can only be /// called on user created objects. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>. /// </remarks> public bool SetUserData(RemotePtr userData) { var call = new CfxV8ValueSetUserDataRenderProcessCall(); call.@this = proxyId; call.userData = userData.ptr; call.RequestExecution(this); return(call.__retval); }
/// <summary> /// The post data element will represent bytes. The bytes passed in will be /// copied. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public void SetToBytes(ulong size, RemotePtr bytes) { var call = new CfxPostDataElementSetToBytesRemoteCall(); call.@this = RemotePtr.ptr; call.size = size; call.bytes = bytes.ptr; call.RequestExecution(RemotePtr.connection); }
/// <summary> /// The post data element will represent bytes. The bytes passed in will be /// copied. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public void SetToBytes(ulong size, RemotePtr bytes) { var call = new CfxPostDataElementSetToBytesRenderProcessCall(); call.@this = proxyId; call.size = size; call.bytes = bytes.ptr; call.RequestExecution(this); }
/// <summary> /// Initialize the command line with the specified |argc| and |argv| values. /// The first argument must be the name of the program. This function is only /// supported on non-Windows platforms. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>. /// </remarks> public void InitFromArgv(int argc, RemotePtr argv) { var call = new CfxCommandLineInitFromArgvRemoteCall(); call.@this = RemotePtr.ptr; call.argc = argc; call.argv = argv.ptr; call.RequestExecution(RemotePtr.connection); }
/// <summary> /// Initialize the command line with the specified |argc| and |argv| values. /// The first argument must be the name of the program. This function is only /// supported on non-Windows platforms. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>. /// </remarks> public void InitFromArgv(int argc, RemotePtr argv) { var call = new CfxCommandLineInitFromArgvRenderProcessCall(); call.@this = proxyId; call.argc = argc; call.argv = argv.ptr; call.RequestExecution(this); }
/// <summary> /// Creates a new object that is not owned by any other object. The specified /// |data| will be copied. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>. /// </remarks> public static CfrBinaryValue Create(RemotePtr data, ulong dataSize) { var call = new CfxBinaryValueCreateRemoteCall(); call.data = data.ptr; call.dataSize = dataSize; call.RequestExecution(); return(CfrBinaryValue.Wrap(new RemotePtr(call.__retval))); }
/// <summary> /// The post data element will represent bytes. The bytes passed in will be /// copied. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public void SetToBytes(int size, RemotePtr bytes) { var call = new CfxPostDataElementSetToBytesRenderProcessCall(); call.self = CfrObject.Unwrap(this); call.size = size; call.bytes = bytes.ptr; call.RequestExecution(this); }
/// <summary> /// Sets the user data for this object and returns true (1) on success. Returns /// false (0) if this function is called incorrectly. This function can only be /// called on user created objects. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>. /// </remarks> public bool SetUserData(RemotePtr userData) { var call = new CfxV8ValueSetUserDataRemoteCall(); call.@this = RemotePtr.ptr; call.userData = userData.ptr; call.RequestExecution(RemotePtr.connection); return(call.__retval); }
/// <summary> /// Sets the user data for this object and returns true (1) on success. Returns /// false (0) if this function is called incorrectly. This function can only be /// called on user created objects. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>. /// </remarks> public bool SetUserData(RemotePtr userData) { var call = new CfxV8ValueSetUserDataRenderProcessCall(); call.self = CfrObject.Unwrap(this); call.userData = userData.ptr; call.RequestExecution(this); return(call.__retval); }
/// <summary> /// Call Marshal.Copy in the target process. /// </summary> public static void Copy(byte[] source, int startIndex, RemotePtr destination, int length) { var call = new CfrMarshalCopyToNativeRemoteCall(); call.source = source; call.startIndex = startIndex; call.destination = destination.ptr; call.length = length; call.RequestExecution(destination.connection); }
/// <summary> /// Read up to |size| bytes into |bytes| and return the number of bytes /// actually read. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public ulong GetBytes(ulong size, RemotePtr bytes) { var call = new CfxPostDataElementGetBytesRemoteCall(); call.@this = RemotePtr.ptr; call.size = size; call.bytes = bytes.ptr; call.RequestExecution(RemotePtr.connection); return(call.__retval); }
/// <summary> /// Call Marshal.Copy in the target process. /// </summary> public static void Copy(RemotePtr source, byte[] destination, int startIndex, int length) { var call = new CfrMarshalCopyToManagedRenderProcessCall(); call.source = source.ptr; call.destination = destination; call.startIndex = startIndex; call.length = length; call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection); }
/// <summary> /// Call Marshal.Copy in the target process. /// </summary> public static void Copy(RemotePtr source, byte[] destination, int startIndex, int length) { var call = new CfrMarshalCopyToManagedRemoteCall(); call.source = source.ptr; call.startIndex = startIndex; call.length = length; call.RequestExecution(source.connection); Array.Copy(call.destination, startIndex, destination, startIndex, length); }
/// <summary> /// Read up to |size| bytes into |bytes| and return the number of bytes /// actually read. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public int GetBytes(int size, RemotePtr bytes) { var call = new CfxPostDataElementGetBytesRenderProcessCall(); call.self = CfrObject.Unwrap(this); call.size = size; call.bytes = bytes.ptr; call.RequestExecution(this); return(call.__retval); }
/// <summary> /// Read uncompressed file contents into the specified buffer. Returns < 0 if /// an error occurred, 0 if at the end of file, or the number of bytes read. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_zip_reader_capi.h">cef/include/capi/cef_zip_reader_capi.h</see>. /// </remarks> public int ReadFile(RemotePtr buffer, ulong bufferSize) { var call = new CfxZipReaderReadFileRemoteCall(); call.@this = RemotePtr.ptr; call.buffer = buffer.ptr; call.bufferSize = bufferSize; call.RequestExecution(RemotePtr.connection); return(call.__retval); }
internal static CfrTime Wrap(RemotePtr remotePtr) { if (remotePtr == RemotePtr.Zero) { return(null); } var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache; return((CfrTime)weakCache.GetOrAdd(remotePtr.ptr, () => new CfrTime(remotePtr))); }
/// <summary> /// Read up to |size| bytes into |bytes| and return the number of bytes /// actually read. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public ulong GetBytes(ulong size, RemotePtr bytes) { var call = new CfxPostDataElementGetBytesRenderProcessCall(); call.@this = proxyId; call.size = size; call.bytes = bytes.ptr; call.RequestExecution(this); return(call.__retval); }
public void Dispose() { if (m_remotePtr != RemotePtr.Zero) { m_remotePtr.connection.weakCache.Remove(m_remotePtr.ptr); OnDispose(m_remotePtr); m_remotePtr = RemotePtr.Zero; GC.SuppressFinalize(this); } }
/// <summary> /// Retrieves the contents of the specified scale independent |resourceId|. If /// the value is found then |data| and |dataSize| will be populated and this /// function will return true (1). If the value is not found then this function /// will return false (0). The returned |data| pointer will remain resident in /// memory and should not be freed. Include cef_pack_resources.h for a listing /// of valid resource ID values. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_resource_bundle_capi.h">cef/include/capi/cef_resource_bundle_capi.h</see>. /// </remarks> public bool GetDataResource(int resourceId, RemotePtr data, ulong dataSize) { var call = new CfxResourceBundleGetDataResourceRemoteCall(); call.@this = RemotePtr.ptr; call.resourceId = resourceId; call.RequestExecution(RemotePtr.connection); data = new RemotePtr(connection, call.data); dataSize = call.dataSize; return(call.__retval); }
/// <summary> /// Read up to |bufferSize| number of bytes into |buffer|. Reading begins at /// the specified byte |dataOffset|. Returns the number of bytes read. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>. /// </remarks> public ulong GetData(RemotePtr buffer, ulong bufferSize, ulong dataOffset) { var call = new CfxBinaryValueGetDataRemoteCall(); call.@this = RemotePtr.ptr; call.buffer = buffer.ptr; call.bufferSize = bufferSize; call.dataOffset = dataOffset; call.RequestExecution(RemotePtr.connection); return(call.__retval); }
/// <summary> /// Read raw binary data. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_stream_capi.h">cef/include/capi/cef_stream_capi.h</see>. /// </remarks> public ulong Read(RemotePtr ptr, ulong size, ulong n) { var call = new CfxStreamReaderReadRemoteCall(); call.@this = RemotePtr.ptr; call.ptr = ptr.ptr; call.size = size; call.n = n; call.RequestExecution(RemotePtr.connection); return(call.__retval); }
internal override void OnDispose(RemotePtr remotePtr) { var call = new CfxApiReleaseRemoteCall(); call.nativePtr = remotePtr.ptr; try { call.RequestExecution(remotePtr.connection); } catch { // if the remote process is gone do nothing } }
/// <summary> /// Read up to |size| bytes into |bytes| and return the number of bytes /// actually read. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public int GetBytes(int size, RemotePtr bytes) { var call = new CfxPostDataElementGetBytesRenderProcessCall(); call.self = CfrObject.Unwrap(this); call.size = size; call.bytes = bytes.ptr; call.RequestExecution(this); return call.__retval; }
/// <summary> /// Read up to |bufferSize| number of bytes into |buffer|. Reading begins at /// the specified byte |dataOffset|. Returns the number of bytes read. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>. /// </remarks> public int GetData(RemotePtr buffer, int bufferSize, int dataOffset) { var call = new CfxBinaryValueGetDataRenderProcessCall(); call.self = CfrObject.Unwrap(this); call.buffer = buffer.ptr; call.bufferSize = bufferSize; call.dataOffset = dataOffset; call.RequestExecution(this); return call.__retval; }
/// <summary> /// Creates a new object that is not owned by any other object. The specified /// |data| will be copied. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>. /// </remarks> public static CfrBinaryValue Create(RemotePtr data, int dataSize) { var call = new CfxBinaryValueCreateRenderProcessCall(); call.data = data.ptr; call.dataSize = dataSize; call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection); return CfrBinaryValue.Wrap(call.__retval); }