Ignore:
Timestamp:
Sep 23, 2010, 12:26:44 AM (11 years ago)
Author:
Sam Hocevar
Message:

Divert CreateFileW in addition to CreateFileA.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/libzzuf/lib-win32.c

    r4657 r4658  
    3737
    3838/* Kernel functions that we divert */
    39 #if defined HAVE_CREATEFILE
    40 static HANDLE (*ORIG(CreateFileA))(LPCTSTR lpFileName, DWORD dwDesiredAccess,
    41            DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes,
    42            DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,
    43            HANDLE hTemplateFile);
     39#if defined HAVE_CREATEFILEA
     40static HANDLE (*ORIG(CreateFileA))(LPCTSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES,
     41                                   DWORD, DWORD, HANDLE);
    4442#endif
    4543
    46 #if defined HAVE_CREATEFILE
     44#if defined HAVE_CREATEFILEA
     45static HANDLE (*ORIG(CreateFileW))(LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES,
     46                                   DWORD, DWORD, HANDLE);
     47#endif
     48
     49#if defined HAVE_CREATEFILEA
    4750HANDLE NEW(CreateFileA)(LPCTSTR lpFileName, DWORD dwDesiredAccess,
    4851           DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes,
     
    5760#endif
    5861
     62#if defined HAVE_CREATEFILEW
     63HANDLE NEW(CreateFileW)(LPCWSTR lpFileName, DWORD dwDesiredAccess,
     64           DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes,
     65           DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,
     66           HANDLE hTemplateFile)
     67{
     68    fprintf(stderr, "CreateFileW diverted!\n");
     69    return ORIG(CreateFileW)(lpFileName, dwDesiredAccess, dwShareMode,
     70                             lpSecurityAttributes, dwCreationDisposition,
     71                             dwFlagsAndAttributes, hTemplateFile);
     72}
     73#endif
     74
    5975/* Win32 function table */
    6076#if defined _WIN32
    6177zzuf_table_t table_win32[] =
    6278{
    63 #if defined HAVE_CREATEFILE
     79#if defined HAVE_CREATEFILEA
    6480    DIVERT(CreateFileA),
     81#endif
     82#if defined HAVE_CREATEFILEW
     83    DIVERT(CreateFileW),
    6584#endif
    6685    DIVERT_END
Note: See TracChangeset for help on using the changeset viewer.