From 5b81f371b67972f7a99fa181a4032e6f69b3f131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Sun, 14 Dec 2003 11:47:54 +0000 Subject: [PATCH] Since LoadLibrary is documented to return NULL on failure, use that as indication of an invalid module handle instead of DDK INVALID_HANDLE_VALUE svn path=/trunk/; revision=7017 --- reactos/lib/ws2_32/misc/catalog.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/lib/ws2_32/misc/catalog.c b/reactos/lib/ws2_32/misc/catalog.c index fa43eedc8b5..347d14dd934 100644 --- a/reactos/lib/ws2_32/misc/catalog.c +++ b/reactos/lib/ws2_32/misc/catalog.c @@ -72,7 +72,7 @@ PCATALOG_ENTRY CreateCatalogEntry( Provider->ReferenceCount = 1; InitializeCriticalSection(&Provider->Lock); - Provider->hModule = (HMODULE)INVALID_HANDLE_VALUE; + Provider->hModule = NULL; Provider->Mapping = NULL; @@ -99,7 +99,7 @@ INT DestroyCatalogEntry( HeapFree(GlobalHeap, 0, Provider->Mapping); - if (Provider->hModule) { + if (NULL != Provider->hModule) { Status = UnloadProvider(Provider); } else { Status = NO_ERROR; @@ -191,7 +191,7 @@ INT LoadProvider( WS_DbgPrint(MAX_TRACE, ("Loading provider at (0x%X) Name (%wZ).\n", Provider, &Provider->LibraryName)); - if (Provider->hModule == INVALID_HANDLE_VALUE) + if (NULL == Provider->hModule) { /* DLL is not loaded so load it now * UNICODE_STRING objects are not null-terminated, but LoadLibraryW @@ -199,7 +199,7 @@ INT LoadProvider( */ Provider->LibraryName.Buffer[Provider->LibraryName.Length] = L'\0'; Provider->hModule = LoadLibraryW(Provider->LibraryName.Buffer); - if (Provider->hModule != INVALID_HANDLE_VALUE) { + if (NULL != Provider->hModule) { Provider->WSPStartup = (LPWSPSTARTUP)GetProcAddress( Provider->hModule, "WSPStartup"); @@ -234,7 +234,7 @@ INT UnloadProvider( WS_DbgPrint(MAX_TRACE, ("Unloading provider at (0x%X)\n", Provider)); - if (Provider->hModule) { + if (NULL != Provider->hModule) { WS_DbgPrint(MAX_TRACE, ("Calling WSPCleanup at (0x%X).\n", Provider->ProcTable.lpWSPCleanup)); Provider->ProcTable.lpWSPCleanup(&Status); @@ -245,7 +245,7 @@ INT UnloadProvider( Status = GetLastError(); } - Provider->hModule = (HMODULE)INVALID_HANDLE_VALUE; + Provider->hModule = NULL; } WS_DbgPrint(MAX_TRACE, ("Status (%d).\n", Status));