OpenRaw

[This is preliminary documentation and subject to change.]

The OpenRaw function opens the specified encrypted file for a backup (export) operation or opens the file for a restore (import) operation.

DWORD OpenRaw(
  LPCTSTR lpFileName,
  ULONG ulFlags,
  PVOID *pvContext
);
 

Parameters

lpFileName
Pointer to a null-terminated string that specifies the name of the file to open.
ulFlags
Specifies file attributes. This parameter may be one or more of the following values.
Value Meaning
0 The file is being opened for export (backup). This is the default option.
CREATE_FOR_IMPORT The file is being opened for import (restore).

pvContext
Pointer that receives a system-defined context block that must be used in subsequent calls to the ReadRaw, WriteRaw, or CloseRaw function.

Return Values

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code defined in WINERROR.H. You can use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.

Remarks

To back up an encrypted file, call OpenRaw to open the file, then call ReadRaw. When the operation is completed, call CloseRaw.

To restore an encrypted file, call OpenRaw specifying CREATE_FOR_IMPORT in the ulFlags parameter, then call WriteRaw. When the operation is completed, call CloseRaw.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in winbase.h.
  Import Library: Use kernel32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

File Systems Overview, File System Functions, CloseRaw, ReadRaw, WriteRaw