mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-29 05:52:52 -05:00
tst: winfsp-tests: HookCreateFileW
This commit is contained in:
34
tst/winfsp-tests/hook.c
Normal file
34
tst/winfsp-tests/hook.c
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <winfsp/winfsp.h>
|
||||
|
||||
HANDLE HookCreateFileW(
|
||||
LPCWSTR lpFileName,
|
||||
DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
DWORD dwFlagsAndAttributes,
|
||||
HANDLE hTemplateFile)
|
||||
{
|
||||
HANDLE h = CreateFileW(
|
||||
lpFileName,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
lpSecurityAttributes,
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
hTemplateFile);
|
||||
|
||||
DWORD LastError = GetLastError();
|
||||
FspDebugLog("CreateFileW(\"%S\", %#lx, %#lx, %p, %#lx, %#lx, %p) = %p[%#lx]\n",
|
||||
lpFileName,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
lpSecurityAttributes,
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
hTemplateFile,
|
||||
h, INVALID_HANDLE_VALUE != h ? 0 : LastError);
|
||||
SetLastError(LastError);
|
||||
|
||||
return h;
|
||||
}
|
Reference in New Issue
Block a user