ReactOS 0.4.15-dev-8145-ga541a46
module.c File Reference
#include "wine/test.h"
#include <windows.h>
#include <stdio.h>
#include <psapi.h>
Include dependency graph for module.c:

Go to the source code of this file.

Macros

#define MAKEFUNC(f)   (p##f = (void*)GetProcAddress(hKernel32, #f))
 

Functions

static DWORD (WINAPI *pGetDllDirectoryA)(DWORD
 
static BOOL (WINAPI *pSetDllDirectoryA)(LPCSTR)
 
static DLL_DIRECTORY_COOKIE (WINAPI *pAddDllDirectory)(const WCHAR *)
 
static BOOL cmpStrAW (const char *a, const WCHAR *b, DWORD lenA, DWORD lenB)
 
static void create_test_dll (const char *name)
 
static void testGetModuleFileName (const char *name)
 
static void testGetModuleFileName_Wrong (void)
 
static void testLoadLibraryA (void)
 
static void testNestedLoadLibraryA (void)
 
static void testLoadLibraryA_Wrong (void)
 
static void testGetProcAddress_Wrong (void)
 
static void testLoadLibraryEx (void)
 
static void test_LoadLibraryEx_search_flags (void)
 
static void testGetDllDirectory (void)
 
static void init_pointers (void)
 
static void testGetModuleHandleEx (void)
 
static void testK32GetModuleInformation (void)
 
static void test_AddDllDirectory (void)
 
static void test_SetDefaultDllDirectories (void)
 
 START_TEST (module)
 

Variables

static LPSTR
 
static LPWSTR
 
static HMODULE module
 
static HMODULE MODULEINFOmodinfo
 
static HMODULE MODULEINFO DWORD cb
 
static BOOL is_unicode_enabled = TRUE
 
struct {
   IMAGE_DOS_HEADER   dos
 
   IMAGE_NT_HEADERS   nt
 
   IMAGE_SECTION_HEADER   section
 
dll_image
 

Macro Definition Documentation

◆ MAKEFUNC

#define MAKEFUNC (   f)    (p##f = (void*)GetProcAddress(hKernel32, #f))

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pSetDllDirectoryA)
static

◆ cmpStrAW()

static BOOL cmpStrAW ( const char a,
const WCHAR b,
DWORD  lenA,
DWORD  lenB 
)
static

Definition at line 37 of file module.c.

38{
39 WCHAR aw[1024];
40
42 a, lenA, aw, sizeof(aw) / sizeof(aw[0]) );
43 if (len != lenB) return FALSE;
44 return memcmp(aw, b, len * sizeof(WCHAR)) == 0;
45}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define FALSE
Definition: types.h:117
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
unsigned long DWORD
Definition: ntddk_ex.h:95
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
BOOL WINAPI AreFileApisANSI(void)
Definition: utils.c:866
#define CP_OEMCP
Definition: winnls.h:231
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by testGetDllDirectory(), and testGetModuleFileName().

◆ create_test_dll()

static void create_test_dll ( const char name)
static

Definition at line 118 of file module.c.

119{
120 DWORD dummy;
122
123 ok( handle != INVALID_HANDLE_VALUE, "failed to create file err %u\n", GetLastError() );
124 WriteFile( handle, &dll_image, sizeof(dll_image), &dummy, NULL );
125 SetFilePointer( handle, dll_image.nt.OptionalHeader.SizeOfImage, NULL, FILE_BEGIN );
128}
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define CloseHandle
Definition: compat.h:739
#define FILE_BEGIN
Definition: compat.h:761
#define SetFilePointer
Definition: compat.h:743
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI SetEndOfFile(HANDLE hFile)
Definition: fileinfo.c:1004
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CREATE_ALWAYS
Definition: disk.h:72
static const struct @1673 dll_image
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: name.c:39
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by test_LoadLibraryEx_search_flags().

◆ DLL_DIRECTORY_COOKIE()

static DLL_DIRECTORY_COOKIE ( WINAPI pAddDllDirectory) const
static

◆ DWORD()

static DWORD ( WINAPI pGetDllDirectoryA)
static

◆ init_pointers()

static void init_pointers ( void  )
static

Definition at line 688 of file module.c.

689{
690 HMODULE hKernel32 = GetModuleHandleA("kernel32.dll");
691
692#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hKernel32, #f))
699 MAKEFUNC(K32GetModuleInformation);
700#undef MAKEFUNC
701
702 /* before Windows 7 this was not exported in kernel32 */
703 if (!pK32GetModuleInformation)
704 {
705 HMODULE hPsapi = LoadLibraryA("psapi.dll");
706 pK32GetModuleInformation = (void *)GetProcAddress(hPsapi, "GetModuleInformation");
707 }
708}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
DWORD WINAPI GetDllDirectoryW(IN DWORD nBufferLength, OUT LPWSTR lpBuffer)
Definition: path.c:887
BOOL WINAPI SetDllDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:838
DWORD WINAPI GetDllDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:915
WINBASEAPI BOOL WINAPI RemoveDllDirectory(DLL_DIRECTORY_COOKIE)
WINBASEAPI DLL_DIRECTORY_COOKIE WINAPI AddDllDirectory(const WCHAR *)
WINBASEAPI BOOL WINAPI SetDefaultDllDirectories(DWORD)
HANDLE hKernel32
Definition: locale.c:13
static HMODULE hPsapi
Definition: integrity.c:31
#define MAKEFUNC(f)

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( module  )

Definition at line 1017 of file module.c.

1018{
1020
1021 /* Test if we can use GetModuleFileNameW */
1022
1023 SetLastError(0xdeadbeef);
1026 {
1027 win_skip("GetModuleFileNameW not existing on this platform, skipping W-calls\n");
1029 }
1030
1031 init_pointers();
1032
1034 testGetModuleFileName("kernel32.dll");
1036
1038
1049}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
static const WCHAR filenameW[]
Definition: amstream.c:41
static void testGetModuleHandleEx(void)
Definition: module.c:710
static void testLoadLibraryA(void)
Definition: module.c:203
static void test_LoadLibraryEx_search_flags(void)
Definition: module.c:462
static void testGetDllDirectory(void)
Definition: module.c:588
static void testGetModuleFileName_Wrong(void)
Definition: module.c:185
static void testGetProcAddress_Wrong(void)
Definition: module.c:291
static void test_AddDllDirectory(void)
Definition: module.c:904
static void testGetModuleFileName(const char *name)
Definition: module.c:130
static BOOL is_unicode_enabled
Definition: module.c:35
static void init_pointers(void)
Definition: module.c:688
static void testLoadLibraryA_Wrong(void)
Definition: module.c:277
static void testLoadLibraryEx(void)
Definition: module.c:306
static void test_SetDefaultDllDirectories(void)
Definition: module.c:950
static void testNestedLoadLibraryA(void)
Definition: module.c:226
static void testK32GetModuleInformation(void)
Definition: module.c:883
#define win_skip
Definition: test.h:163

◆ test_AddDllDirectory()

static void test_AddDllDirectory ( void  )
static

Definition at line 904 of file module.c.

905{
906 static const WCHAR tmpW[] = {'t','m','p',0};
907 static const WCHAR dotW[] = {'.','\\','.',0};
908 static const WCHAR rootW[] = {'\\',0};
911 BOOL ret;
912
913 if (!pAddDllDirectory || !pRemoveDllDirectory)
914 {
915 win_skip( "AddDllDirectory not available\n" );
916 return;
917 }
918
919 buf[0] = '\0';
920 GetTempPathW( sizeof(path)/sizeof(path[0]), path );
921 ret = GetTempFileNameW( path, tmpW, 0, buf );
922 ok( ret, "GetTempFileName failed err %u\n", GetLastError() );
923 SetLastError( 0xdeadbeef );
924 cookie = pAddDllDirectory( buf );
925 ok( cookie != NULL, "AddDllDirectory failed err %u\n", GetLastError() );
926 SetLastError( 0xdeadbeef );
927 ret = pRemoveDllDirectory( cookie );
928 ok( ret, "RemoveDllDirectory failed err %u\n", GetLastError() );
929
930 DeleteFileW( buf );
931 SetLastError( 0xdeadbeef );
932 cookie = pAddDllDirectory( buf );
933 ok( !cookie, "AddDllDirectory succeeded\n" );
934 ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError() );
935 cookie = pAddDllDirectory( dotW );
936 ok( !cookie, "AddDllDirectory succeeded\n" );
937 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
938 cookie = pAddDllDirectory( rootW );
939 ok( cookie != NULL, "AddDllDirectory failed err %u\n", GetLastError() );
940 SetLastError( 0xdeadbeef );
941 ret = pRemoveDllDirectory( cookie );
942 ok( ret, "RemoveDllDirectory failed err %u\n", GetLastError() );
944 lstrcpyW( buf + 2, tmpW );
945 cookie = pAddDllDirectory( buf );
946 ok( !cookie, "AddDllDirectory succeeded\n" );
947 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
948}
static const WCHAR rootW[]
Definition: chain.c:69
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define lstrcpyW
Definition: compat.h:749
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const WCHAR dotW[]
Definition: directory.c:80
Definition: cookie.c:34
int ret

Referenced by START_TEST().

◆ test_LoadLibraryEx_search_flags()

static void test_LoadLibraryEx_search_flags ( void  )
static

Definition at line 462 of file module.c.

463{
464 static const struct
465 {
466 int add_dirs[4];
467 int dll_dir;
468 int expect;
469 } tests[] =
470 {
471 { { 1, 2, 3 }, 4, 3 }, /* 0 */
472 { { 1, 3, 2 }, 4, 2 },
473 { { 3, 1 }, 4, 1 },
474 { { 5, 6 }, 4, 4 },
475 { { 5, 2 }, 4, 2 },
476 { { 0 }, 4, 4 }, /* 5 */
477 { { 0 }, 0, 0 },
478 { { 6, 5 }, 5, 0 },
479 { { 1, 1, 2 }, 0, 2 },
480 };
481 char *p, path[MAX_PATH], buf[MAX_PATH];
482 WCHAR bufW[MAX_PATH];
484 unsigned int i, j, k;
485 BOOL ret;
486 HMODULE mod;
487
488 if (!pAddDllDirectory || !pSetDllDirectoryA) return;
489
490 GetTempPathA( sizeof(path), path );
491 GetTempFileNameA( path, "tmp", 0, buf );
492 DeleteFileA( buf );
494 ok( ret, "CreateDirectory failed err %u\n", GetLastError() );
495 p = buf + strlen( buf );
496 for (i = 1; i <= 6; i++)
497 {
498 sprintf( p, "\\%u", i );
500 ok( ret, "CreateDirectory failed err %u\n", GetLastError() );
501 if (i >= 5) continue; /* dirs 5 and 6 are left empty */
502 sprintf( p, "\\%u\\winetestdll.dll", i );
504 }
505 SetLastError( 0xdeadbeef );
506 mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR );
507 ok( !mod, "LoadLibrary succeeded\n" );
508 ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() );
509
510 SetLastError( 0xdeadbeef );
511 mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_USER_DIRS );
512 ok( !mod, "LoadLibrary succeeded\n" );
514 "wrong error %u\n", GetLastError() );
515
516 SetLastError( 0xdeadbeef );
517 mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 );
518 ok( !mod, "LoadLibrary succeeded\n" );
519 ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() );
520
521 SetLastError( 0xdeadbeef );
522 mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR );
523 ok( !mod, "LoadLibrary succeeded\n" );
524 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
525
526 SetLastError( 0xdeadbeef );
528 ok( !mod, "LoadLibrary succeeded\n" );
529 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
530
531 SetLastError( 0xdeadbeef );
532 mod = LoadLibraryExA( "foo\\winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR );
533 ok( !mod, "LoadLibrary succeeded\n" );
534 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
535
536 SetLastError( 0xdeadbeef );
537 mod = LoadLibraryExA( "\\windows\\winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR );
538 ok( !mod, "LoadLibrary succeeded\n" );
539 ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() );
540
541 for (j = 0; j < sizeof(tests) / sizeof(tests[0]); j++)
542 {
543 for (k = 0; tests[j].add_dirs[k]; k++)
544 {
545 sprintf( p, "\\%u", tests[j].add_dirs[k] );
546 MultiByteToWideChar( CP_ACP, 0, buf, -1, bufW, MAX_PATH );
547 cookies[k] = pAddDllDirectory( bufW );
548 ok( cookies[k] != NULL, "failed to add %s\n", buf );
549 }
550 if (tests[j].dll_dir)
551 {
552 sprintf( p, "\\%u", tests[j].dll_dir );
553 pSetDllDirectoryA( buf );
554 }
555 else pSetDllDirectoryA( NULL );
556
557 SetLastError( 0xdeadbeef );
558 mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_USER_DIRS );
559 if (tests[j].expect)
560 {
561 ok( mod != NULL, "%u: LoadLibrary failed err %u\n", j, GetLastError() );
563 sprintf( p, "\\%u\\winetestdll.dll", tests[j].expect );
564 ok( !lstrcmpiA( path, buf ), "%u: wrong module %s expected %s\n", j, path, buf );
565 }
566 else
567 {
568 ok( !mod, "%u: LoadLibrary succeeded\n", j );
570 "%u: wrong error %u\n", j, GetLastError() );
571 }
572 FreeLibrary( mod );
573
574 for (k = 0; tests[j].add_dirs[k]; k++) pRemoveDllDirectory( cookies[k] );
575 }
576
577 for (i = 1; i <= 6; i++)
578 {
579 sprintf( p, "\\%u\\winetestdll.dll", i );
580 DeleteFileA( buf );
581 sprintf( p, "\\%u", i );
583 }
584 *p = 0;
586}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483
#define broken(x)
Definition: _sntprintf.h:21
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_MOD_NOT_FOUND
Definition: compat.h:104
#define FreeLibrary(x)
Definition: compat.h:748
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:159
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2054
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4223
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
Definition: filename.c:26
GLfloat GLfloat p
Definition: glext.h:8902
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static int mod
Definition: i386-dis.c:1288
static struct test_info tests[]
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static void create_test_dll(const char *name)
Definition: module.c:118
int k
Definition: mpi.c:3369
static CookieInternal * cookies
Definition: msctf.c:65
#define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
Definition: winbase.h:350
#define LOAD_LIBRARY_SEARCH_SYSTEM32
Definition: winbase.h:353
#define LOAD_LIBRARY_SEARCH_USER_DIRS
Definition: winbase.h:352
#define LOAD_LIBRARY_SEARCH_APPLICATION_DIR
Definition: winbase.h:351

Referenced by START_TEST().

◆ test_SetDefaultDllDirectories()

static void test_SetDefaultDllDirectories ( void  )
static

Definition at line 950 of file module.c.

951{
952 HMODULE mod;
953 BOOL ret;
954
955 if (!pSetDefaultDllDirectories)
956 {
957 win_skip( "SetDefaultDllDirectories not available\n" );
958 return;
959 }
960
961 mod = LoadLibraryA( "authz.dll" );
962 ok( mod != NULL, "loading authz failed\n" );
963 FreeLibrary( mod );
964 ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_USER_DIRS );
965 ok( ret, "SetDefaultDllDirectories failed err %u\n", GetLastError() );
966 mod = LoadLibraryA( "authz.dll" );
967 todo_wine ok( !mod, "loading authz succeeded\n" );
968 FreeLibrary( mod );
969 ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_SYSTEM32 );
970 ok( ret, "SetDefaultDllDirectories failed err %u\n", GetLastError() );
971 mod = LoadLibraryA( "authz.dll" );
972 ok( mod != NULL, "loading authz failed\n" );
973 FreeLibrary( mod );
975 todo_wine ok( !mod, "loading authz succeeded\n" );
976 FreeLibrary( mod );
977 ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_APPLICATION_DIR );
978 ok( ret, "SetDefaultDllDirectories failed err %u\n", GetLastError() );
979 mod = LoadLibraryA( "authz.dll" );
980 todo_wine ok( !mod, "loading authz succeeded\n" );
981 FreeLibrary( mod );
982 ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DEFAULT_DIRS );
983 ok( ret, "SetDefaultDllDirectories failed err %u\n", GetLastError() );
984 mod = LoadLibraryA( "authz.dll" );
985 ok( mod != NULL, "loading authz failed\n" );
986 FreeLibrary( mod );
987
988 SetLastError( 0xdeadbeef );
989 ret = pSetDefaultDllDirectories( 0 );
990 ok( !ret, "SetDefaultDllDirectories succeeded\n" );
991 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
992
993 SetLastError( 0xdeadbeef );
994 ret = pSetDefaultDllDirectories( 3 );
995 ok( !ret, "SetDefaultDllDirectories succeeded\n" );
996 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
997
998 SetLastError( 0xdeadbeef );
999 ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_APPLICATION_DIR | 0x8000 );
1000 ok( !ret, "SetDefaultDllDirectories succeeded\n" );
1001 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
1002
1003 SetLastError( 0xdeadbeef );
1004 ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR );
1005 ok( !ret || broken(ret) /* win7 */, "SetDefaultDllDirectories succeeded\n" );
1006 if (!ret) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
1007
1008 SetLastError( 0xdeadbeef );
1010 ok( !ret || broken(ret) /* win7 */, "SetDefaultDllDirectories succeeded\n" );
1011 if (!ret) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
1012
1013 /* restore some sane defaults */
1014 pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DEFAULT_DIRS );
1015}
#define todo_wine
Definition: custom.c:79
#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
Definition: winbase.h:354

Referenced by START_TEST().

◆ testGetDllDirectory()

static void testGetDllDirectory ( void  )
static

Definition at line 588 of file module.c.

589{
590 CHAR bufferA[MAX_PATH];
591 WCHAR bufferW[MAX_PATH];
593 int i;
594 static const char *dll_directories[] =
595 {
596 "",
597 "C:\\Some\\Path",
598 "C:\\Some\\Path\\",
599 "Q:\\A\\Long\\Path with spaces that\\probably\\doesn't exist!",
600 };
601 const int test_count = sizeof(dll_directories) / sizeof(dll_directories[0]);
602
603 if (!pGetDllDirectoryA || !pGetDllDirectoryW)
604 {
605 win_skip("GetDllDirectory not available\n");
606 return;
607 }
608 if (!pSetDllDirectoryA)
609 {
610 win_skip("SetDllDirectoryA not available\n");
611 return;
612 }
613
614 for (i = 0; i < test_count; i++)
615 {
616 length = strlen(dll_directories[i]);
617 if (!pSetDllDirectoryA(dll_directories[i]))
618 {
619 skip("i=%d, SetDllDirectoryA failed\n", i);
620 continue;
621 }
622
623 /* no buffer, determine length */
624 ret = pGetDllDirectoryA(0, NULL);
625 ok(ret == length + 1, "Expected %u, got %u\n", length + 1, ret);
626
627 ret = pGetDllDirectoryW(0, NULL);
628 ok(ret == length + 1, "Expected %u, got %u\n", length + 1, ret);
629
630 /* buffer of exactly the right size */
631 bufferA[length] = 'A';
632 bufferA[length + 1] = 'A';
633 ret = pGetDllDirectoryA(length + 1, bufferA);
634 ok(ret == length || broken(ret + 1 == length) /* win8 */,
635 "i=%d, Expected %u(+1), got %u\n", i, length, ret);
636 ok(bufferA[length + 1] == 'A', "i=%d, Buffer overflow\n", i);
637 ok(strcmp(bufferA, dll_directories[i]) == 0, "i=%d, Wrong path returned: '%s'\n", i, bufferA);
638
639 bufferW[length] = 'A';
640 bufferW[length + 1] = 'A';
641 ret = pGetDllDirectoryW(length + 1, bufferW);
642 ok(ret == length, "i=%d, Expected %u, got %u\n", i, length, ret);
643 ok(bufferW[length + 1] == 'A', "i=%d, Buffer overflow\n", i);
644 ok(cmpStrAW(dll_directories[i], bufferW, length, length),
645 "i=%d, Wrong path returned: %s\n", i, wine_dbgstr_w(bufferW));
646
647 /* Zero size buffer. The buffer may or may not be terminated depending
648 * on the Windows version and whether the A or W API is called. */
649 bufferA[0] = 'A';
650 ret = pGetDllDirectoryA(0, bufferA);
651 ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
652
653 bufferW[0] = 'A';
654 ret = pGetDllDirectoryW(0, bufferW);
655 ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
656 ok(bufferW[0] == 0 || /* XP, 2003 */
657 broken(bufferW[0] == 'A'), "i=%d, Buffer overflow\n", i);
658
659 /* buffer just one too short */
660 bufferA[0] = 'A';
661 ret = pGetDllDirectoryA(length, bufferA);
662 ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
663 if (length != 0)
664 ok(bufferA[0] == 0, "i=%d, Buffer not null terminated\n", i);
665
666 bufferW[0] = 'A';
667 ret = pGetDllDirectoryW(length, bufferW);
668 ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
669 ok(bufferW[0] == 0 || /* XP, 2003 */
670 broken(bufferW[0] == 'A'), "i=%d, Buffer overflow\n", i);
671
672 if (0)
673 {
674 /* crashes on win8 */
675 /* no buffer, but too short length */
676 ret = pGetDllDirectoryA(length, NULL);
677 ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
678
679 ret = pGetDllDirectoryW(length, NULL);
680 ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret);
681 }
682 }
683
684 /* unset whatever we did so following tests won't be affected */
685 pSetDllDirectoryA(NULL);
686}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define skip(...)
Definition: atltest.h:64
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define wine_dbgstr_w
Definition: kernel32.h:34
UINT test_count
Definition: shader.c:5671
static BOOL cmpStrAW(const char *a, const WCHAR *b, DWORD lenA, DWORD lenB)
Definition: module.c:37
char CHAR
Definition: xmlstorage.h:175

Referenced by START_TEST().

◆ testGetModuleFileName()

static void testGetModuleFileName ( const char name)
static

Definition at line 130 of file module.c.

131{
132 HMODULE hMod;
133 char bufA[MAX_PATH];
134 WCHAR bufW[MAX_PATH];
135 DWORD len1A, len1W = 0, len2A, len2W = 0;
136
137 hMod = (name) ? GetModuleHandleA(name) : NULL;
138
139 /* first test, with enough space in buffer */
140 memset(bufA, '-', sizeof(bufA));
141 SetLastError(0xdeadbeef);
142 len1A = GetModuleFileNameA(hMod, bufA, sizeof(bufA));
144 broken(GetLastError() == 0xdeadbeef), /* <= XP SP3 */
145 "LastError was not reset: %u\n", GetLastError());
146 ok(len1A > 0, "Getting module filename for handle %p\n", hMod);
147
149 {
150 memset(bufW, '-', sizeof(bufW));
151 SetLastError(0xdeadbeef);
152 len1W = GetModuleFileNameW(hMod, bufW, sizeof(bufW) / sizeof(WCHAR));
154 broken(GetLastError() == 0xdeadbeef), /* <= XP SP3 */
155 "LastError was not reset: %u\n", GetLastError());
156 ok(len1W > 0, "Getting module filename for handle %p\n", hMod);
157 }
158
159 ok(len1A == strlen(bufA), "Unexpected length of GetModuleFilenameA (%d/%d)\n", len1A, lstrlenA(bufA));
160
162 {
163 ok(len1W == lstrlenW(bufW), "Unexpected length of GetModuleFilenameW (%d/%d)\n", len1W, lstrlenW(bufW));
164 ok(cmpStrAW(bufA, bufW, len1A, len1W), "Comparing GetModuleFilenameAW results\n");
165 }
166
167 /* second test with a buffer too small */
168 memset(bufA, '-', sizeof(bufA));
169 len2A = GetModuleFileNameA(hMod, bufA, len1A / 2);
170 ok(len2A > 0, "Getting module filename for handle %p\n", hMod);
171
173 {
174 memset(bufW, '-', sizeof(bufW));
175 len2W = GetModuleFileNameW(hMod, bufW, len1W / 2);
176 ok(len2W > 0, "Getting module filename for handle %p\n", hMod);
177 ok(cmpStrAW(bufA, bufW, len2A, len2W), "Comparing GetModuleFilenameAW results with buffer too small\n" );
178 ok(len1W / 2 == len2W, "Correct length in GetModuleFilenameW with buffer too small (%d/%d)\n", len1W / 2, len2W);
179 }
180
181 ok(len1A / 2 == len2A,
182 "Correct length in GetModuleFilenameA with buffer too small (%d/%d)\n", len1A / 2, len2A);
183}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define lstrlenW
Definition: compat.h:750
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ testGetModuleFileName_Wrong()

static void testGetModuleFileName_Wrong ( void  )
static

Definition at line 185 of file module.c.

186{
187 char bufA[MAX_PATH];
188 WCHAR bufW[MAX_PATH];
189
190 /* test wrong handle */
192 {
193 bufW[0] = '*';
194 ok(GetModuleFileNameW((void*)0xffffffff, bufW, sizeof(bufW) / sizeof(WCHAR)) == 0, "Unexpected success in module handle\n");
195 ok(bufW[0] == '*', "When failing, buffer shouldn't be written to\n");
196 }
197
198 bufA[0] = '*';
199 ok(GetModuleFileNameA((void*)0xffffffff, bufA, sizeof(bufA)) == 0, "Unexpected success in module handle\n");
200 ok(bufA[0] == '*', "When failing, buffer shouldn't be written to\n");
201}

Referenced by START_TEST().

◆ testGetModuleHandleEx()

static void testGetModuleHandleEx ( void  )
static

Definition at line 710 of file module.c.

711{
712 static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0};
713 static const WCHAR nosuchmodW[] = {'n','o','s','u','c','h','m','o','d',0};
714 BOOL ret;
715 DWORD error;
716 HMODULE mod, mod_kernel32;
717
718 SetLastError( 0xdeadbeef );
721 ok( !ret, "unexpected success\n" );
722 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
723
724 SetLastError( 0xdeadbeef );
725 ret = GetModuleHandleExA( 0, "kernel32", NULL );
727 ok( !ret, "unexpected success\n" );
728 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
729
730 SetLastError( 0xdeadbeef );
731 mod = (HMODULE)0xdeadbeef;
732 ret = GetModuleHandleExA( 0, "kernel32", &mod );
733 ok( ret, "unexpected failure %u\n", GetLastError() );
734 ok( mod != (HMODULE)0xdeadbeef, "got %p\n", mod );
735 FreeLibrary( mod );
736
737 SetLastError( 0xdeadbeef );
738 mod = (HMODULE)0xdeadbeef;
739 ret = GetModuleHandleExA( 0, "nosuchmod", &mod );
741 ok( !ret, "unexpected success\n" );
742 ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error );
743 ok( mod == NULL, "got %p\n", mod );
744
745 SetLastError( 0xdeadbeef );
748 ok( !ret, "unexpected success\n" );
749 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
750
751 SetLastError( 0xdeadbeef );
752 ret = GetModuleHandleExW( 0, kernel32W, NULL );
754 ok( !ret, "unexpected success\n" );
755 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
756
757 SetLastError( 0xdeadbeef );
758 mod = (HMODULE)0xdeadbeef;
759 ret = GetModuleHandleExW( 0, kernel32W, &mod );
760 ok( ret, "unexpected failure %u\n", GetLastError() );
761 ok( mod != (HMODULE)0xdeadbeef, "got %p\n", mod );
762 FreeLibrary( mod );
763
764 SetLastError( 0xdeadbeef );
765 mod = (HMODULE)0xdeadbeef;
766 ret = GetModuleHandleExW( 0, nosuchmodW, &mod );
768 ok( !ret, "unexpected success\n" );
769 ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error );
770 ok( mod == NULL, "got %p\n", mod );
771
772 SetLastError( 0xdeadbeef );
773 ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, NULL );
775 ok( !ret, "unexpected success\n" );
776 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
777
778 SetLastError( 0xdeadbeef );
779 ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, "kernel32", NULL );
781 ok( !ret, "unexpected success\n" );
782 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
783
784 SetLastError( 0xdeadbeef );
785 mod = (HMODULE)0xdeadbeef;
786 ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, "kernel32", &mod );
787 ok( ret, "unexpected failure %u\n", GetLastError() );
788 ok( mod != (HMODULE)0xdeadbeef, "got %p\n", mod );
789
790 SetLastError( 0xdeadbeef );
791 mod = (HMODULE)0xdeadbeef;
792 ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, "nosuchmod", &mod );
794 ok( !ret, "unexpected success\n" );
795 ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error );
796 ok( mod == NULL, "got %p\n", mod );
797
798 SetLastError( 0xdeadbeef );
799 ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, NULL );
801 ok( !ret, "unexpected success\n" );
802 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
803
804 SetLastError( 0xdeadbeef );
805 ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, kernel32W, NULL );
807 ok( !ret, "unexpected success\n" );
808 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
809
810 SetLastError( 0xdeadbeef );
811 mod = (HMODULE)0xdeadbeef;
812 ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, kernel32W, &mod );
813 ok( ret, "unexpected failure %u\n", GetLastError() );
814 ok( mod != (HMODULE)0xdeadbeef, "got %p\n", mod );
815
816 SetLastError( 0xdeadbeef );
817 mod = (HMODULE)0xdeadbeef;
818 ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, nosuchmodW, &mod );
820 ok( !ret, "unexpected success\n" );
821 ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error );
822 ok( mod == NULL, "got %p\n", mod );
823
824 mod_kernel32 = LoadLibraryA( "kernel32" );
825
826 SetLastError( 0xdeadbeef );
827 ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, NULL, NULL );
829 ok( !ret, "unexpected success\n" );
830 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
831
832 SetLastError( 0xdeadbeef );
833 ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)mod_kernel32, NULL );
835 ok( !ret, "unexpected success\n" );
836 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
837
838 SetLastError( 0xdeadbeef );
839 mod = (HMODULE)0xdeadbeef;
840 ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)mod_kernel32, &mod );
841 ok( ret, "unexpected failure %u\n", GetLastError() );
842 ok( mod == mod_kernel32, "got %p\n", mod );
843 FreeLibrary( mod );
844
845 SetLastError( 0xdeadbeef );
846 mod = (HMODULE)0xdeadbeef;
847 ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)0xbeefdead, &mod );
849 ok( !ret, "unexpected success\n" );
850 ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error );
851 ok( mod == NULL, "got %p\n", mod );
852
853 SetLastError( 0xdeadbeef );
854 ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, NULL, NULL );
856 ok( !ret, "unexpected success\n" );
857 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
858
859 SetLastError( 0xdeadbeef );
860 ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCWSTR)mod_kernel32, NULL );
862 ok( !ret, "unexpected success\n" );
863 ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error );
864
865 SetLastError( 0xdeadbeef );
866 mod = (HMODULE)0xdeadbeef;
867 ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCWSTR)mod_kernel32, &mod );
868 ok( ret, "unexpected failure %u\n", GetLastError() );
869 ok( mod == mod_kernel32, "got %p\n", mod );
870 FreeLibrary( mod );
871
872 SetLastError( 0xdeadbeef );
873 mod = (HMODULE)0xdeadbeef;
874 ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCWSTR)0xbeefdead, &mod );
876 ok( !ret, "unexpected success\n" );
877 ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error );
878 ok( mod == NULL, "got %p\n", mod );
879
880 FreeLibrary( mod_kernel32 );
881}
BOOL WINAPI GetModuleHandleExW(IN DWORD dwFlags, IN LPCWSTR lpwModuleName OPTIONAL, OUT HMODULE *phModule)
Definition: loader.c:866
BOOL WINAPI GetModuleHandleExA(IN DWORD dwFlags, IN LPCSTR lpModuleName OPTIONAL, OUT HMODULE *phModule)
Definition: loader.c:896
#define error(str)
Definition: mkdosfs.c:1605
HANDLE HMODULE
Definition: typedefs.h:77
const char * LPCSTR
Definition: xmlstorage.h:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by START_TEST().

◆ testGetProcAddress_Wrong()

static void testGetProcAddress_Wrong ( void  )
static

Definition at line 291 of file module.c.

292{
293 FARPROC fp;
294
295 SetLastError(0xdeadbeef);
296 fp = GetProcAddress(NULL, "non_ex_call");
297 ok( !fp, "non_ex_call should not be found\n");
298 ok( GetLastError() == ERROR_PROC_NOT_FOUND, "Expected ERROR_PROC_NOT_FOUND, got %d\n", GetLastError() );
299
300 SetLastError(0xdeadbeef);
301 fp = GetProcAddress((HMODULE)0xdeadbeef, "non_ex_call");
302 ok( !fp, "non_ex_call should not be found\n");
303 ok( GetLastError() == ERROR_MOD_NOT_FOUND, "Expected ERROR_MOD_NOT_FOUND, got %d\n", GetLastError() );
304}
int(* FARPROC)()
Definition: compat.h:36
#define ERROR_PROC_NOT_FOUND
Definition: winerror.h:199

Referenced by START_TEST().

◆ testK32GetModuleInformation()

static void testK32GetModuleInformation ( void  )
static

Definition at line 883 of file module.c.

884{
886 HMODULE mod;
887 BOOL ret;
888
890 memset(&info, 0xAA, sizeof(info));
891 ret = pK32GetModuleInformation(GetCurrentProcess(), mod, &info, sizeof(info));
892 ok(ret, "K32GetModuleInformation failed for main module\n");
893 ok(info.lpBaseOfDll == mod, "Wrong info.lpBaseOfDll = %p, expected %p\n", info.lpBaseOfDll, mod);
894 ok(info.EntryPoint != NULL, "Expected nonzero entrypoint\n");
895
896 mod = GetModuleHandleA("kernel32.dll");
897 memset(&info, 0xAA, sizeof(info));
898 ret = pK32GetModuleInformation(GetCurrentProcess(), mod, &info, sizeof(info));
899 ok(ret, "K32GetModuleInformation failed for kernel32 module\n");
900 ok(info.lpBaseOfDll == mod, "Wrong info.lpBaseOfDll = %p, expected %p\n", info.lpBaseOfDll, mod);
901 ok(info.EntryPoint != NULL, "Expected nonzero entrypoint\n");
902}
#define GetCurrentProcess()
Definition: compat.h:759

Referenced by START_TEST().

◆ testLoadLibraryA()

static void testLoadLibraryA ( void  )
static

Definition at line 203 of file module.c.

204{
205 HMODULE hModule, hModule1;
206 FARPROC fp;
207
208 SetLastError(0xdeadbeef);
209 hModule = LoadLibraryA("kernel32.dll");
210 ok( hModule != NULL, "kernel32.dll should be loadable\n");
211 ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %d\n", GetLastError());
212
213 fp = GetProcAddress(hModule, "CreateFileA");
214 ok( fp != NULL, "CreateFileA should be there\n");
215 ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %d\n", GetLastError());
216
217 SetLastError(0xdeadbeef);
218 hModule1 = LoadLibraryA("kernel32 ");
219 ok( hModule1 != NULL, "\"kernel32 \" should be loadable\n" );
220 ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %d\n", GetLastError() );
221 ok( hModule == hModule1, "Loaded wrong module\n" );
222 FreeLibrary(hModule1);
224}
HMODULE hModule
Definition: animate.c:44

Referenced by START_TEST().

◆ testLoadLibraryA_Wrong()

static void testLoadLibraryA_Wrong ( void  )
static

Definition at line 277 of file module.c.

278{
280
281 /* Try to load a nonexistent dll */
282 SetLastError(0xdeadbeef);
283 hModule = LoadLibraryA("non_ex_pv.dll");
284 ok( !hModule, "non_ex_pv.dll should be not loadable\n");
285 ok( GetLastError() == ERROR_MOD_NOT_FOUND, "Expected ERROR_MOD_NOT_FOUND, got %d\n", GetLastError() );
286
287 /* Just in case */
289}

Referenced by START_TEST().

◆ testLoadLibraryEx()

static void testLoadLibraryEx ( void  )
static

Definition at line 306 of file module.c.

307{
310 HANDLE hfile;
311 BOOL ret;
312
313 hfile = CreateFileA("testfile.dll", GENERIC_READ | GENERIC_WRITE,
316 ok(hfile != INVALID_HANDLE_VALUE, "Expected a valid file handle\n");
317
318 /* NULL lpFileName */
319 SetLastError(0xdeadbeef);
321 ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
324 "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
325
326 /* empty lpFileName */
327 SetLastError(0xdeadbeef);
328 hmodule = LoadLibraryExA("", NULL, 0);
329 ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
332 "Expected ERROR_MOD_NOT_FOUND or ERROR_DLL_NOT_FOUND, got %d\n", GetLastError());
333
334 /* hFile is non-NULL */
335 SetLastError(0xdeadbeef);
336 hmodule = LoadLibraryExA("testfile.dll", hfile, 0);
337 ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
339 {
341 GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */
342 "Unexpected last error, got %d\n", GetLastError());
343 }
344
345 SetLastError(0xdeadbeef);
346 hmodule = LoadLibraryExA("testfile.dll", (HANDLE)0xdeadbeef, 0);
347 ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
349 {
351 GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */
352 "Unexpected last error, got %d\n", GetLastError());
353 }
354
355 /* try to open a file that is locked */
356 SetLastError(0xdeadbeef);
357 hmodule = LoadLibraryExA("testfile.dll", NULL, 0);
358 ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
360 {
362 "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError());
363 }
364
365 /* lpFileName does not matter */
367 {
368 SetLastError(0xdeadbeef);
369 hmodule = LoadLibraryExA(NULL, hfile, 0);
370 ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
372 GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */
373 "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
374 }
375
376 CloseHandle(hfile);
377
378 /* load empty file */
379 SetLastError(0xdeadbeef);
381 ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
383 {
385 "Expected ERROR_FILE_INVALID, got %d\n", GetLastError());
386 }
387
388 DeleteFileA("testfile.dll");
389
391 if (path[lstrlenA(path) - 1] != '\\')
392 lstrcatA(path, "\\");
393 lstrcatA(path, "kernel32.dll");
394
395 /* load kernel32.dll with an absolute path */
396 SetLastError(0xdeadbeef);
398 ok(hmodule != 0, "Expected valid module handle\n");
399 ok(GetLastError() == 0xdeadbeef ||
401 "Expected 0xdeadbeef or ERROR_SUCCESS, got %d\n", GetLastError());
402
403 /* try invalid file handle */
404 SetLastError(0xdeadbeef);
405 hmodule = LoadLibraryExA(path, (HANDLE)0xdeadbeef, 0);
406 if (!hmodule) /* succeeds on xp and older */
407 ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError());
408
410
411 /* load kernel32.dll with no path */
412 SetLastError(0xdeadbeef);
414 ok(hmodule != 0, "Expected valid module handle\n");
415 ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
416
418
420 if (path[lstrlenA(path) - 1] != '\\')
421 lstrcatA(path, "\\");
422 lstrcatA(path, "kernel32.dll");
423
424 /* load kernel32.dll with an absolute path that does not exist */
425 SetLastError(0xdeadbeef);
428 {
429 ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
430 }
432 "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
433
434 /* Free the loaded dll when it's the first time this dll is loaded
435 in process - First time should pass, second fail */
436 SetLastError(0xdeadbeef);
438 ok(hmodule != 0, "Expected valid module handle\n");
439
440 SetLastError(0xdeadbeef);
442 ok(ret, "Expected to be able to free the module, failed with %d\n", GetLastError());
443 SetLastError(0xdeadbeef);
445 ok(!ret, "Unexpected ability to free the module, failed with %d\n", GetLastError());
446
447 /* load with full path, name without extension */
449 if (path[lstrlenA(path) - 1] != '\\')
450 lstrcatA(path, "\\");
451 lstrcatA(path, "kernel32");
453 ok(hmodule != NULL, "got %p\n", hmodule);
455
456 /* same with alterate search path */
458 ok(hmodule != NULL, "got %p\n", hmodule);
460}
#define GENERIC_READ
Definition: compat.h:135
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2283
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
static HMODULE hmodule
Definition: rasapi.c:29
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:342
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:344
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:135
#define ERROR_FILE_INVALID
Definition: winerror.h:585

Referenced by START_TEST().

◆ testNestedLoadLibraryA()

static void testNestedLoadLibraryA ( void  )
static

Definition at line 226 of file module.c.

227{
228 static const char dllname[] = "shell32.dll";
230 HMODULE hModule1, hModule2, hModule3;
231
232 /* This is not really a Windows conformance test, but more a Wine
233 * regression test. Wine's builtin dlls can be loaded from multiple paths,
234 * and this test tries to make sure that Wine does not get confused and
235 * really unloads the Unix .so file at the right time. Failure to do so
236 * will result in the dll being unloadable.
237 * This test must be done with a dll that can be unloaded, which means:
238 * - it must not already be loaded
239 * - it must not have a 16-bit counterpart
240 */
242 strcat(path1, "\\system\\");
243 strcat(path1, dllname);
244 hModule1 = LoadLibraryA(path1);
245 if (!hModule1)
246 {
247 /* We must be on Windows, so we cannot test */
248 return;
249 }
250
252 strcat(path2, "\\system32\\");
253 strcat(path2, dllname);
254 hModule2 = LoadLibraryA(path2);
255 ok(hModule2 != NULL, "LoadLibrary(%s) failed\n", path2);
256
257 /* The first LoadLibrary() call may have registered the dll under the
258 * system32 path. So load it, again, under the '...\system\...' path so
259 * Wine does not immediately notice that it is already loaded.
260 */
261 hModule3 = LoadLibraryA(path1);
262 ok(hModule3 != NULL, "LoadLibrary(%s) failed\n", path1);
263
264 /* Now fully unload the dll */
265 ok(FreeLibrary(hModule3), "FreeLibrary() failed\n");
266 ok(FreeLibrary(hModule2), "FreeLibrary() failed\n");
267 ok(FreeLibrary(hModule1), "FreeLibrary() failed\n");
268 ok(GetModuleHandleA(dllname) == NULL, "%s was not fully unloaded\n", dllname);
269
270 /* Try to load the dll again, if refcounting is ok, this should work */
271 hModule1 = LoadLibraryA(path1);
272 ok(hModule1 != NULL, "LoadLibrary(%s) failed\n", path1);
273 if (hModule1 != NULL)
274 ok(FreeLibrary(hModule1), "FreeLibrary() failed\n");
275}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
static const WCHAR path1[]
Definition: path.c:28
static const WCHAR path2[]
Definition: path.c:29

Referenced by START_TEST().

Variable Documentation

◆ cb

Definition at line 33 of file module.c.

Referenced by _bdf_readstream(), CRegPropertyBag::_CopyStreamIntoBuff(), AboutProtocol_Read(), accumulating_stream_output(), add_ms_root_certs(), add_properties(), AllocADsMem(), anonymous_namespace{activex.cpp}::AllocLpsz(), AMFilterData_ParseFilterData(), AVISplitter_ProcessIndex(), AVISplitter_ProcessODML(), AVISplitter_ProcessStreamList(), BindProtocol_Read(), cabinet_alloc(), cabinet_read(), cabinet_read_stream(), cabinet_write(), cert_mgr_dlg_proc(), CertContext_CopyParam(), check_convertible(), check_wellknown_name(), compareStore(), _com_util::ConvertBSTRToString(), create_show_list(), CardWindow::CreateButton(), CRYPT_findPropID(), CRYPT_ReadContextProp(), cvid_v1_15(), cvid_v1_16(), cvid_v1_24(), cvid_v1_32(), cvid_v4_15(), cvid_v4_16(), cvid_v4_24(), cvid_v4_32(), d3dcompiler_parse_rdef(), d3dcompiler_parse_variables(), d3dcompiler_shader_reflection_GetVariableByName(), d3drm1_CreateUserVisual(), d3drm1_EnumerateObjects(), d3drm2_CreateUserVisual(), d3drm2_EnumerateObjects(), d3drm3_CreateUserVisual(), d3drm3_EnumerateObjects(), d3drm_animation1_AddDestroyCallback(), d3drm_animation1_DeleteDestroyCallback(), d3drm_animation2_AddDestroyCallback(), d3drm_animation2_DeleteDestroyCallback(), d3drm_device1_AddDestroyCallback(), d3drm_device1_AddUpdateCallback(), d3drm_device1_DeleteDestroyCallback(), d3drm_device1_DeleteUpdateCallback(), d3drm_device2_AddDestroyCallback(), d3drm_device2_AddUpdateCallback(), d3drm_device2_DeleteDestroyCallback(), d3drm_device2_DeleteUpdateCallback(), d3drm_device3_AddDestroyCallback(), d3drm_device3_AddUpdateCallback(), d3drm_device3_DeleteDestroyCallback(), d3drm_device3_DeleteUpdateCallback(), d3drm_device_win_AddDestroyCallback(), d3drm_device_win_DeleteDestroyCallback(), d3drm_face1_AddDestroyCallback(), d3drm_face1_DeleteDestroyCallback(), d3drm_face2_AddDestroyCallback(), d3drm_face2_DeleteDestroyCallback(), d3drm_frame1_AddDestroyCallback(), d3drm_frame1_AddMoveCallback(), d3drm_frame1_DeleteDestroyCallback(), d3drm_frame1_DeleteMoveCallback(), d3drm_frame1_Load(), d3drm_frame2_AddDestroyCallback(), d3drm_frame2_AddMoveCallback(), d3drm_frame2_AddMoveCallback2(), d3drm_frame2_DeleteDestroyCallback(), d3drm_frame2_DeleteMoveCallback(), d3drm_frame2_Load(), d3drm_frame3_AddDestroyCallback(), d3drm_frame3_AddMoveCallback(), d3drm_frame3_DeleteDestroyCallback(), d3drm_frame3_DeleteMoveCallback(), d3drm_frame3_Load(), d3drm_light_AddDestroyCallback(), d3drm_light_DeleteDestroyCallback(), d3drm_material_AddDestroyCallback(), d3drm_material_DeleteDestroyCallback(), d3drm_mesh_AddDestroyCallback(), d3drm_mesh_builder2_AddDestroyCallback(), d3drm_mesh_builder2_DeleteDestroyCallback(), d3drm_mesh_builder2_Load(), d3drm_mesh_builder3_AddDestroyCallback(), d3drm_mesh_builder3_DeleteDestroyCallback(), d3drm_mesh_builder3_Load(), d3drm_mesh_DeleteDestroyCallback(), d3drm_object_add_destroy_callback(), d3drm_object_delete_destroy_callback(), d3drm_texture1_AddDestroyCallback(), d3drm_texture1_DeleteDestroyCallback(), d3drm_texture2_AddDestroyCallback(), d3drm_texture2_DeleteDestroyCallback(), d3drm_texture3_AddDestroyCallback(), d3drm_texture3_DeleteDestroyCallback(), d3drm_texture3_SetDownsampleCallback(), d3drm_texture3_SetValidationCallback(), d3drm_viewport1_AddDestroyCallback(), d3drm_viewport1_DeleteDestroyCallback(), d3drm_viewport2_AddDestroyCallback(), d3drm_viewport2_DeleteDestroyCallback(), d3drm_wrap_AddDestroyCallback(), d3drm_wrap_DeleteDestroyCallback(), DdeAddData(), DdeCreateDataHandle(), ddraw7_EnumDisplayModes(), ddraw_surface7_EnumAttachedSurfaces(), ddraw_surface7_EnumOverlayZOrders(), DECLARE_INTERFACE_(), CardWindow::DeleteButton(), detail_dlg_proc(), dispex_traverse(), DlgMainProc(), BtrfsChangeDriveLetter::DlgProc(), do_searchW(), do_test_about_protocol(), downloadcb_create(), Graphics::DrawCachedBitmap(), DumpBytes(), DuplicateString(), DuplicationString(), EditStreamCallback(), elf_enum_modules(), elf_enum_modules_internal(), EnumDeviceDrivers(), EnumDirTree(), EnumDirTreeW(), EnumProcesses(), EnumProcessModules(), EnumWindowsProc(), ExtractFilesFromZip(), fci_get_checksum(), fci_read(), fci_write(), fdi_alloc(), fdi_mem_read(), fdi_mem_write(), fdi_read(), fdi_read_static(), fdi_write(), FileLockBytesImpl_LockRegion(), FileLockBytesImpl_ReadAt(), FileLockBytesImpl_UnlockRegion(), FileLockBytesImpl_WriteAt(), FileProtocol_Read(), fill_filter_data_information(), FindExeCplClass(), findPropID(), FNALLOC(), FNREAD(), FNWRITE(), format_enhanced_key_usage_value(), format_hex_string(), format_string_callback(), free_constant_buffer(), FtpProtocol_Read(), GdipGetImageThumbnail(), get_cert_property_as_string(), GetAssocClass(), CExtractIcon::GetIconLocation(), GetModuleInformation(), GetPerformanceInfo(), GetProcessMemoryInfo(), GetRegString(), GetWsChanges(), GopherProtocol_Read(), HEXEDIT_Copy(), HEXEDIT_Paste(), HGLOBALLockBytesImpl_ReadAt(), HGLOBALLockBytesImpl_WriteAt(), HGLOBALStreamImpl_CopyTo(), HGLOBALStreamImpl_Read(), HGLOBALStreamImpl_Write(), HLPFILE_BPTreeEnum(), horAcc8(), HTMLAnchorElement_traverse(), HTMLBodyElement_traverse(), HTMLButtonElement_traverse(), HTMLDocumentNode_traverse(), HTMLDOMNode_traverse(), HTMLFormElement_traverse(), HTMLFrameElement_traverse(), HTMLIFrame_traverse(), HTMLImgElement_traverse(), HTMLInputElement_traverse(), HTMLLinkElement_traverse(), HTMLObjectElement_traverse(), HTMLOptionElement_traverse(), HTMLScriptElement_traverse(), HTMLSelectElement_traverse(), HTMLStyleElement_traverse(), HTMLTable_traverse(), HTMLTableCell_traverse(), HTMLTableRow_traverse(), HTMLTextAreaElement_traverse(), HttpProtocol_Read(), ICGetInfo(), IchAnsiFromWide(), IFillLockBytes_FillAppend_Proxy(), IFillLockBytes_FillAppend_Stub(), IFillLockBytes_FillAt_Proxy(), IFillLockBytes_FillAt_Stub(), III_dequantize_sample(), ILockBytes_ReadAt_Proxy(), ILockBytes_ReadAt_Stub(), ILockBytes_WriteAt_Proxy(), ILockBytes_WriteAt_Stub(), IMalloc_fnAlloc(), IMalloc_fnRealloc(), IMAPIMalloc_fnAlloc(), IMAPIMalloc_fnRealloc(), Imm32CompStrAnsiToWide(), Imm32CompStrWideToAnsi(), ImmGetConversionListA(), ImmGetConversionListW(), ImmGetGuideLineAW(), init_layer3(), initFileFromData(), initialize_purpose_selection(), InitPropVariantFromBuffer(), InitVariantFromBuffer(), SEALED_::IQuickActivate::QuickActivate(), ISequentialStream_Read_Proxy(), ISequentialStream_Read_Stub(), ISequentialStream_Write_Proxy(), ISequentialStream_Write_Stub(), IStream_CopyTo_Proxy(), IStream_CopyTo_Stub(), IStream_fnCopyTo(), IStream_fnLockUnlockRegion(), IStream_fnRead(), IStream_fnWrite(), ITSProtocol_Read(), ITSS_IStream_Read(), IWICStreamImpl_CopyTo(), IWICStreamImpl_LockRegion(), IWICStreamImpl_Read(), IWICStreamImpl_UnlockRegion(), IWICStreamImpl_Write(), JoyConfig8Impl_EnumTypes(), LayoutInit(), macho_enum_load_commands(), macho_enum_modules(), macho_enum_modules_internal(), MD_ComboBox_OnInitStorage(), MD_ListBox_OnInitStorage(), ME_AppendToHGLOBAL(), ME_ReadFromHGLOBALRTF(), ME_ReadFromHGLOBALUnicode(), ME_ReadFromRTFString(), mem_alloc(), MimeAlloc_Alloc(), MimeAlloc_Realloc(), MimeFilterProtocol_Read(), MimeHtmlProtocol_Read(), MimeProtocol_Read(), MkProtocol_Read(), mmTaskCreate(), mp_prime_random_ex(), mxstream_Write(), NetBIOSEnumAdapters(), CACLCustomMRU::Next(), nfs41_handle_callback(), NoStatStreamImpl_CopyTo(), NoStatStreamImpl_Read(), NoStatStreamImpl_Write(), pdb_load_stream_name_table(), pdlgex_hook_proc(), printBytes(), PropVariantToBuffer(), Protocol_Read(), ProtocolEmul_Read(), ProtocolHandler_Read(), ProtocolSink_ReportData(), ProtocolStream_CopyTo(), ProtocolStream_LockRegion(), ProtocolStream_Read(), ProtocolStream_UnlockRegion(), ProtocolStream_Write(), QueryWorkingSet(), QueryWorkingSetEx(), read_key(), read_text_callback(), ReadChunkIntoExtra(), ReadExtraChunk(), refresh_details_view(), RegFindRecurse(), ResProtocol_Read(), RpcStream_Read(), RpcStream_Write(), rpn_exec_int(), SampleGrabber_ISampleGrabber_SetCallback(), save_base64(), save_der(), sc_cb_alloc(), sc_cb_read(), sc_cb_write(), SHELL_GetRegCLSID(), show_store_certs(), START_TEST(), StgStreamImpl_CopyTo(), StgStreamImpl_Read(), StgStreamImpl_Write(), StorageImpl_CheckLockRange(), StorageImpl_Destroy(), StorageImpl_GrabLocks(), StorageImpl_LockOne(), StorageImpl_LockRegion(), StorageImpl_LockRegionSync(), StorageImpl_LockTransaction(), StorageImpl_UnlockRegion(), StorageImpl_UnlockTransaction(), stream_in(), stream_out(), Stream_Read(), StreamOnFileHandle_CopyTo(), StreamOnFileHandle_LockRegion(), StreamOnFileHandle_Read(), StreamOnFileHandle_UnlockRegion(), StreamOnFileHandle_Write(), StreamOnMemory_CopyTo(), StreamOnMemory_LockRegion(), StreamOnMemory_Read(), StreamOnMemory_UnlockRegion(), StreamOnMemory_Write(), StreamOnStreamRange_CopyTo(), StreamOnStreamRange_LockRegion(), StreamOnStreamRange_Read(), StreamOnStreamRange_UnlockRegion(), StreamOnStreamRange_Write(), sub_stream_CopyTo(), sub_stream_Read(), sym_register_cb(), SymEnumLines(), SymFindFileInPath(), SymFindFileInPathW(), SymRegisterFunctionEntryCallback(), SymRegisterFunctionEntryCallback64(), template_hook(), test_CoInternetQueryInfo(), test_copyto(), test_CreateWellKnownSid(), test_EM_GETMODIFY_esCallback(), test_EM_STREAMIN_esCallback(), test_EM_STREAMIN_esCallback2(), test_esCallback_written_1(), test_file_protocol_url(), test_ftp_protocol(), test_http_protocol_url(), test_open_url_async(), test_pack_DISPLAY_DEVICEA(), test_pack_DISPLAY_DEVICEW(), test_pack_SHChangeDWORDAsIDList(), test_pack_SHChangeProductKeyAsIDList(), test_pack_SHITEMID(), test_pack_STARTUPINFOA(), test_pack_STARTUPINFOW(), test_pack_TTPOLYGONHEADER(), test_protocol_terminate(), test_protocol_url(), test_rasenum(), test_res_protocol(), test_status_callbacks(), Test_Stream_Read(), Test_Stream_Write(), test_WM_SETTEXT_esCallback(), TestLockBytes_ReadAt(), TestLockBytes_SetSize(), TestLockBytes_WriteAt(), teststream_Write(), Thunk_DDrawSurface3_EnumAttachedSurfaces(), Thunk_DDrawSurface3_EnumOverlayZOrders(), ThunkDirectDraw2_EnumDisplayModes(), ThunkDirectDraw2_EnumSurfaces(), ThunkDirectDraw4_EnumDisplayModes(), ThunkDirectDraw4_EnumSurfaces(), ThunkDirectDraw_EnumDisplayModes(), ThunkDirectDraw_EnumSurfaces(), WINHELP_RtfStreamIn(), WINTRUST_Alloc(), WINTRUST_ReAlloc(), CRegPropertyBag::Write(), ycc_rgb_convert(), and ycck_cmyk_convert().

◆ 

const struct { ... } dll_image

Referenced by create_test_dll().

◆ dos

◆ is_unicode_enabled

BOOL is_unicode_enabled = TRUE
static

◆ LPSTR

Definition at line 26 of file module.c.

◆ LPWSTR

Definition at line 27 of file module.c.

◆ modinfo

HMODULE MODULEINFO* modinfo

Definition at line 33 of file module.c.

Referenced by test_pe_checksum().

◆ module

Definition at line 32 of file module.c.

◆ nt

◆ section

Definition at line 51 of file module.c.