网站首页  词典首页

请输入您要查询的函数:

 

术语 backupwrite
释义 BackupWrite
语法:
C++
BOOL BackupWrite(
__in HANDLE hFile,
__in LPBYTE lpBuffer,
__in DWORD nNumberOfBytesToWrite,
__out LPDWORD lpNumberOfBytesWritten,
__in BOOL bAbort,
__in BOOL bProcessSecurity,
__out LPVOID *lpContext
);
BackupWrite功能
该BackupWrite函数可以用来恢复的文件或目录是放弃使用BackupRead支持。使用ReadFile函数来得到一个从备份中的数据流,然后使用BackupWrite将数据写入到指定的文件或目录。
参数
hFile [in]
处理的文件或目录恢复。要获取处理,调用CreateFile函数。该SACLs无法恢复的文件句柄,除非是与ACCESS_SYSTEM_SECURITY访问权限创建。为确保完整性ACE是正确还原,文件处理也必须经过与WRITE_OWNER访问权限创建。有关更多信息,请参阅文件安全性和访问权限。
Windows Server 2003和Windows XP/2000操作系统:在WRITE_OWNER探视权并不是必需的。
句柄必须同步(同步方式)。这意味着FILE_FLAG_OVERLAPPED标志不得时设置CreateFile调用。此函数不验证它接收的处理是同步的,因此它不返回错误代码的同步处理,而是一个异步调用(重叠它)处理可以细微的错误结果,是很难调试。
该BackupWrite函数可能会失败CreateFile是与国旗FILE_FLAG_NO_BUFFERING要求。在这种情况下,GetLastError函数返回值ERROR_INVALID_PARAMETER。
lpBuffer [in]
缓冲区指针,函数写入的数据。
nNumberOfBytesToWrite [in]
大小的缓冲区,以字节为单位。缓冲区的大小必须大于1 WIN32_STREAM_ID结构的大小。
lpNumberOfBytesWritten [out]
指针变量,它接收写入的字节数。
bAbort [in]
指示是否使用完的处理BackupWrite。当您还原该文件,指定此参数为FALSE。在您使用完BackupWrite,必须调用BackupWrite一个更多的时间,指定此参数为TRUE,并通过适当lpContext。 lpContext必须通过bAbort为TRUE时,所有其他参数将被忽略。
bProcessSecurity [in]
指定是否会恢复功能,访问控制列表(ACL)的文件或目录的数据。
如果bProcessSecurity为TRUE,则需要指定WRITE_OWNER和WRITE_DAC访问时,打开文件或目录处理。如果没有处理这些访问权限,操作系统拒绝访问的ACL数据,数据恢复和ACL不会发生。
lpContext [out]
指针变量接收一个指向内部数据结构BackupWrite用来维持还原操作期间上下文信息。
您必须设置变量所指向的lpContext为NULL在第一次调用BackupWrite指定的文件或目录。函数分配的内存数据结构,然后设置变量指向的结构。您不得改变lpContext或变量,它指向呼吁BackupWrite之间。
要释放的数据结构使用的内存,请设置为TRUE时,还原操作bAbort参数BackupWrite完成。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零,表明一个I / O错误。为了获得更多错误信息,调用GetLastError。
备注
此功能不用于恢复下的加密文件系统加密文件的使用。使用WriteEncryptedFileRaw用于这一目的。
数据读取备份介质必须由WIN32_STREAM_ID结构分隔substreams。
流类型的BACKUP_LINK让您恢复与硬链接的文件。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
BackupRead
BackupSeek
CreateFile
WriteEncryptedFileRaw
WIN32_STREAM_ID
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==BackupWrite Function
The BackupWrite function can be used to restore a file or directory that was backed up using BackupRead . Use the ReadFile function to get a stream of data from the backup medium, then use BackupWrite to write the data to the specified file or directory.
Syntax
C++
BOOL BackupWrite(
__in HANDLE hFile,
__in LPBYTE lpBuffer,
__in DWORD nNumberOfBytesToWrite,
__out LPDWORD lpNumberOfBytesWritten,
__in BOOL bAbort,
__in BOOL bProcessSecurity,
__out LPVOID *lpContext
);
Parameters
hFile [in]
Handle to the file or directory to be restored. To obtain the handle, call the CreateFile function. The SACLs are not restored unless the file handle was created with the ACCESS_SYSTEM_SECURITY access right. To ensure that the integrity ACEs are restored correctly, the file handle must also have been created with the WRITE_OWNER access right. For more information, see File Security and Access Rights .
Windows Server 2003 and Windows XP/2000: The WRITE_OWNER access right is not required.
The handle must be synchronous (nonoverlapped). This means that the FILE_FLAG_OVERLAPPED flag must not be set when CreateFile is called. This function does not validate that the handle it receives is synchronous, so it does not return an error code for a synchronous handle, but calling it with an asynchronous (overlapped) handle can result in subtle errors that are very difficult to debug.
The BackupWrite function may fail if CreateFile was called with the flag FILE_FLAG_NO_BUFFERING. In this case, the GetLastError function returns the value ERROR_INVALID_PARAMETER.
lpBuffer [in]
Pointer to a buffer that the function writes data from.
nNumberOfBytesToWrite [in]
Size of the buffer, in bytes. The buffer size must be greater than the size of a WIN32_STREAM_ID structure.
lpNumberOfBytesWritten [out]
Pointer to a variable that receives the number of bytes written.
bAbort [in]
Indicates whether you have finished using BackupWrite on the handle. While you are restoring the file, specify this parameter as FALSE. After you are done using BackupWrite, you must call BackupWrite one more time specifying TRUE for this parameter and passing the appropriate lpContext. lpContext must be passed when bAbort is TRUE; all other parameters are ignored.
bProcessSecurity [in]
Specifies whether the function will restore the access-control list (ACL) data for the file or directory.
If bProcessSecurity is TRUE, you need to specify WRITE_OWNER and WRITE_DAC access when opening the file or directory handle. If the handle does not have those access rights, the operating system denies access to the ACL data, and ACL data restoration will not occur.
lpContext [out]
Pointer to a variable that receives a pointer to an internal data structure used by BackupWrite to maintain context information during a restore operation.
You must set the variable pointed to by lpContext to NULL before the first call to BackupWrite for the specified file or directory. The function allocates memory for the data structure, and then sets the variable to point to that structure. You must not change lpContext or the variable that it points to between calls to BackupWrite.
To release the memory used by the data structure, call BackupWrite with the bAbort parameter set to TRUE when the restore operation is complete.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero, indicating that an I/O error occurred. To get extended error information, call GetLastError .
Remarks
This function is not intended for use in restoring files encrypted under the Encrypted File System . Use WriteEncryptedFileRaw for that purpose.
The data read from the backup medium must be substreams separated by WIN32_STREAM_ID structures.
The BACKUP_LINK stream type lets you restore files with hard links.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
BackupRead
BackupSeek
CreateFile
WriteEncryptedFileRaw
WIN32_STREAM_ID
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa362511(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:26:45