Changeset 4658 for zzuf


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

Divert CreateFileW in addition to CreateFileA.

Location:
zzuf/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/configure.ac

    r4656 r4658  
    5555AC_CHECK_FUNCS(__open64 __lseek64 __fopen64 __freopen64 __ftello64 __fseeko64 __fsetpos64)
    5656AC_CHECK_FUNCS(__fgets_chk __fgets_unlocked_chk __fread_chk __fread_unlocked_chk __read_chk __recv_chk __recvfrom_chk)
    57 AC_CHECK_FUNCS(CreateFile)
     57AC_CHECK_FUNCS(CreateFileA CreateFileW)
    5858
    5959AC_CHECK_TYPES(sighandler_t, [], [],
  • zzuf/trunk/msvc/config.h

    r4656 r4658  
    2626#define HAVE_BIND 1
    2727#define HAVE_CONNECT 1
    28 #define HAVE_CREATEFILE 1
     28#define HAVE_CREATEFILEA 1
     29#define HAVE_CREATEFILEW 1
    2930/* #undef HAVE_DLFCN_H */
    3031#define HAVE_DUP 1
  • 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.