Commit f0dd63cb authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

msvcrt: The tests link with msvcrt(d).dll now, so use GetModuleHandle() rather than LoadLibrary().

parent 7aa9ea4e
...@@ -184,7 +184,9 @@ static void* do_call_func2(void *func, void *_this, const void* arg) ...@@ -184,7 +184,9 @@ static void* do_call_func2(void *func, void *_this, const void* arg)
static void InitFunctionPtrs(void) static void InitFunctionPtrs(void)
{ {
hMsvcrt = LoadLibraryA("msvcrt.dll"); hMsvcrt = GetModuleHandleA("msvcrt.dll");
if (!hMsvcrt)
hMsvcrt = GetModuleHandleA("msvcrtd.dll");
ok(hMsvcrt != 0, "LoadLibraryA failed\n"); ok(hMsvcrt != 0, "LoadLibraryA failed\n");
if (hMsvcrt) if (hMsvcrt)
{ {
......
...@@ -111,8 +111,12 @@ START_TEST(string) ...@@ -111,8 +111,12 @@ START_TEST(string)
{ {
void *mem; void *mem;
static const char xilstring[]="c:/xilinx"; static const char xilstring[]="c:/xilinx";
int nLen=strlen(xilstring); int nLen;
HMODULE hMsvcrt = LoadLibraryA("msvcrt.dll"); HMODULE hMsvcrt;
hMsvcrt = GetModuleHandleA("msvcrt.dll");
if (!hMsvcrt)
hMsvcrt = GetModuleHandleA("msvcrtd.dll");
ok(hMsvcrt != 0, "LoadLibraryA failed\n"); ok(hMsvcrt != 0, "LoadLibraryA failed\n");
SET(pmemcpy,"memcpy"); SET(pmemcpy,"memcpy");
SET(pmemcmp,"memcmp"); SET(pmemcmp,"memcmp");
...@@ -122,6 +126,7 @@ START_TEST(string) ...@@ -122,6 +126,7 @@ START_TEST(string)
mem = malloc(100); mem = malloc(100);
ok(mem != NULL, "memory not allocated for size 0\n"); ok(mem != NULL, "memory not allocated for size 0\n");
strcpy((char*)mem,xilstring); strcpy((char*)mem,xilstring);
nLen=strlen(xilstring);
pmemcpy((char*)mem+5, mem,nLen+1); pmemcpy((char*)mem+5, mem,nLen+1);
ok(pmemcmp((char*)mem+5,xilstring, nLen) == 0, ok(pmemcmp((char*)mem+5,xilstring, nLen) == 0,
"Got result %s\n",(char*)mem+5); "Got result %s\n",(char*)mem+5);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment