BoxedAppSDK_CreateVirtualFileBasedOnBuffer
Description
The function creates a virtual file with the contents located in the specified buffer. Thus, the contents is both read from the buffer and written to the specified buffer. That file is useful when you need to create a virtual file of an invariable size (in particular, when the file is read-only). The arguments of BoxedAppSDK_CreateVirtualFileBasedOnBuffer are similar to the arguments of the winapi function CreateFile.
Syntax
C++
HANDLE _stdcall BoxedAppSDK_CreateVirtualFileBasedOnBuffer(
LPCTSTR szPath,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile,
PVOID pData,
DWORD dwSize);
Delphi
function BoxedAppSDK_CreateVirtualFileBasedOnBuffer(
lpFileName: PAnsiChar;
dwDesiredAccess, dwShareMode: Integer;
lpSecurityAttributes: PSecurityAttributes;
dwCreationDisposition, dwFlagsAndAttributes: DWORD;
hTemplateFile: THandle;
pData: Pointer;
dwSize: DWORD): THandle; stdcall;
function BoxedAppSDK_CreateVirtualFileBasedOnBufferA(
lpFileName: PAnsiChar;
dwDesiredAccess, dwShareMode: Integer;
lpSecurityAttributes: PSecurityAttributes;
dwCreationDisposition, dwFlagsAndAttributes: DWORD;
hTemplateFile: THandle;
pData: Pointer;
dwSize: DWORD): THandle; stdcall;
function BoxedAppSDK_CreateVirtualFileBasedOnBufferW(
lpFileName: PWideChar;
dwDesiredAccess, dwShareMode: Integer;
lpSecurityAttributes: PSecurityAttributes;
dwCreationDisposition, dwFlagsAndAttributes: DWORD;
hTemplateFile: THandle;
pData: Pointer;
dwSize: DWORD): THandle; stdcall;
Parameters
lpFileName
The name, relative or full path of the virtual file to be created.
dwDesiredAccess
The requested access.
dwShareMode
The sharing mode.
lpSecurityAttributes
A pointer to a SECURITY_ATTRIBUTES structure that optionally specifies security descriptor, and whether the file handle can be inherited by child processes. It's ignored by BoxedApp currently.
dwCreationDisposition
An action to take on a virtual file that exists or doesn't exist.
dwFlagsAndAttributes
Combination of FILE_FLAG_* and FILE_ATTRIBUTE_*. You can pass 0.
pData
The virtual file will read and write data from this buffer.
dwSize
The buffer size.