static IntPtr FindFirstFileWHook(String fileName, IntPtr lpFindFileData) { ServerConfigHooker main = (ServerConfigHooker)HookRuntimeInfo.Callback; string newFileName = ((ServerHookCallback)main.hookCallback).OnFindFirstFile(fileName); return(FindFirstFileW(newFileName, lpFindFileData)); }
static IntPtr CreateFileWHook( String fileName, UInt32 dwDesiredAccess, UInt32 dwShareMode, IntPtr lpSecurityAttributes, UInt32 dwCreationDisposition, UInt32 dwFlagsAndAttributes, IntPtr hTemplateFile ) { ServerConfigHooker main = (ServerConfigHooker)HookRuntimeInfo.Callback; string newFileName = ((ServerHookCallback)main.hookCallback).OnCreateFile(fileName); return(CreateFileW( newFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile )); }