[WS2_32]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 19 Feb 2017 12:05:48 +0000 (12:05 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 19 Feb 2017 12:05:48 +0000 (12:05 +0000)
- Fix ridiculous over-casting

svn path=/trunk/; revision=73840

12 files changed:
reactos/dll/win32/ws2_32/inc/ws2_32p.h
reactos/dll/win32/ws2_32/src/addrinfo.c
reactos/dll/win32/ws2_32/src/async.c
reactos/dll/win32/ws2_32/src/dcatalog.c
reactos/dll/win32/ws2_32/src/dcatitem.c
reactos/dll/win32/ws2_32/src/dprocess.c
reactos/dll/win32/ws2_32/src/dprovide.c
reactos/dll/win32/ws2_32/src/getxbyxx.c
reactos/dll/win32/ws2_32/src/nscatalo.c
reactos/dll/win32/ws2_32/src/nsprovid.c
reactos/dll/win32/ws2_32/src/nsquery.c
reactos/dll/win32/ws2_32/src/qshelpr.c

index 0908bc7..37c061b 100644 (file)
@@ -98,7 +98,7 @@ typedef struct _TCATALOG
     DWORD UniqueId;
     DWORD NextId;
     HKEY CatalogKey;
-    RTL_CRITICAL_SECTION Lock;
+    CRITICAL_SECTION Lock;
     BOOLEAN Initialized;
 } TCATALOG, *PTCATALOG;
 
@@ -139,7 +139,7 @@ typedef struct _NSCATALOG
     DWORD ItemCount;
     DWORD UniqueId;
     HKEY CatalogKey;
-    RTL_CRITICAL_SECTION Lock;
+    CRITICAL_SECTION Lock;
 } NSCATALOG, *PNSCATALOG;
 
 typedef struct _NSQUERY
@@ -149,7 +149,7 @@ typedef struct _NSQUERY
     BOOLEAN ShuttingDown;
     LIST_ENTRY ProviderList;
     PNSQUERY_PROVIDER ActiveProvider;
-    RTL_CRITICAL_SECTION Lock;
+    CRITICAL_SECTION Lock;
     PNSQUERY_PROVIDER CurrentProvider;
     LPWSAQUERYSETW QuerySet;
     DWORD ControlFlags;
@@ -169,7 +169,7 @@ typedef struct _WSPROCESS
     HANDLE NamespaceCatalogEvent;
     DWORD Version;
     BOOLEAN LockReady;
-    RTL_CRITICAL_SECTION ThreadLock;
+    CRITICAL_SECTION ThreadLock;
 } WSPROCESS, *PWSPROCESS;
 
 typedef struct _WSTHREAD
@@ -270,11 +270,11 @@ extern PWS_SOCK_POST_ROUTINE WsSockPostRoutine;
 
 LPSTR
 WSAAPI
-AnsiDupFromUnicode(IN LPWSTR UnicodeString);
+AnsiDupFromUnicode(IN LPCWSTR UnicodeString);
 
 LPWSTR
 WSAAPI
-UnicodeDupFromAnsi(IN LPSTR AnsiString);
+UnicodeDupFromAnsi(IN LPCSTR AnsiString);
 
 VOID
 WSAAPI
index 14f5d87..97f93a7 100644 (file)
@@ -816,7 +816,7 @@ getaddrinfo(const char FAR *nodename,
     /* Convert the node name */
     if (nodename)
     {
-        UnicodeNodeName = UnicodeDupFromAnsi((LPSTR)nodename);
+        UnicodeNodeName = UnicodeDupFromAnsi(nodename);
         if (!UnicodeNodeName)
         {
             /* Prepare to fail */
@@ -828,7 +828,7 @@ getaddrinfo(const char FAR *nodename,
     /* Convert the servname too, if we have one */
     if (servname)
     {
-        UnicodeServName = UnicodeDupFromAnsi((LPSTR)servname);
+        UnicodeServName = UnicodeDupFromAnsi(servname);
         if (!UnicodeServName)
         {
             /* Prepare to fail */
index caa7694..6a0bfb0 100644 (file)
@@ -700,8 +700,9 @@ WsAsyncGetHost(IN HANDLE TaskHandle,
 
 DWORD
 WINAPI
-WsAsyncThread(IN PWSASYNCCONTEXT Context)
+WsAsyncThread(IN PVOID ThreadContext)
 {
+    PWSASYNCCONTEXT Context = ThreadContext;
     PWSASYNCBLOCK AsyncBlock;
     PLIST_ENTRY Entry;
     HANDLE AsyncEvent = Context->AsyncEvent;
@@ -859,7 +860,7 @@ WsAsyncCheckAndInitThread(VOID)
         /* Create the thread */
         ThreadHandle = CreateThread(NULL,
                                     0,
-                                    (LPTHREAD_START_ROUTINE)WsAsyncThread,
+                                    WsAsyncThread,
                                     Context,
                                     0,
                                     &Tid);
index 6dc58f9..6eccd2f 100644 (file)
@@ -15,8 +15,8 @@
 
 /* DATA **********************************************************************/
 
-#define WsTcLock()          EnterCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
-#define WsTcUnlock()        LeaveCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
+#define WsTcLock()          EnterCriticalSection(&Catalog->Lock);
+#define WsTcUnlock()        LeaveCriticalSection(&Catalog->Lock);
 
 /* FUNCTIONS *****************************************************************/
 
@@ -49,7 +49,7 @@ WsTcOpen(IN PTCATALOG Catalog,
     CHAR* CatalogKeyName;
 
     /* Initialize the catalog lock and namespace list */
-    InitializeCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
+    InitializeCriticalSection(&Catalog->Lock);
     InitializeListHead(&Catalog->ProtocolList);
 
     /* Read the catalog name */
@@ -759,7 +759,7 @@ WsTcFindIfsProviderForSocket(IN PTCATALOG Catalog,
     PTPROVIDER Provider;
     IN SOCKET NewHandle;
     INT Error;
-    DWORD OptionLength;
+    INT OptionLength;
     PLIST_ENTRY Entry;
     WSAPROTOCOL_INFOW ProtocolInfo;
     DWORD UniqueId;
@@ -811,7 +811,7 @@ CatalogChanged:
                                                       SOL_SOCKET,
                                                       SO_PROTOCOL_INFOW,
                                                       (PCHAR)&ProtocolInfo,
-                                                      (LPINT)&OptionLength,
+                                                      &OptionLength,
                                                       &Error);
 
         /* Dereference the entry and check the result */
@@ -895,7 +895,7 @@ WsTcDelete(IN PTCATALOG Catalog)
 
     /* Release and delete the lock */
     WsTcUnlock();
-    DeleteCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
+    DeleteCriticalSection(&Catalog->Lock);
 
     /* Delete the object */
     HeapFree(WsSockHeap, 0, Catalog);
index 511cbf4..2507e4c 100644 (file)
@@ -100,7 +100,7 @@ WsTcEntryInitializeFromRegistry(IN PTCATALOG_ENTRY CatalogEntry,
                               &RegSize);
 
 
-    memcpy(CatalogEntry->DllPath, (LPCSTR)Buf, sizeof(CatalogEntry->DllPath));
+    memcpy(CatalogEntry->DllPath, Buf, sizeof(CatalogEntry->DllPath));
     index = sizeof(CatalogEntry->DllPath);
     if(index < RegSize)
     {
index fd02255..d0aa43a 100644 (file)
@@ -14,8 +14,8 @@
 
 PWSPROCESS CurrentWsProcess;
 
-#define WsProcLock()      EnterCriticalSection((LPCRITICAL_SECTION)&Process->ThreadLock);
-#define WsProcUnlock()    LeaveCriticalSection((LPCRITICAL_SECTION)&Process->ThreadLock);
+#define WsProcLock()      EnterCriticalSection(&Process->ThreadLock);
+#define WsProcUnlock()    LeaveCriticalSection(&Process->ThreadLock);
 
 /* FUNCTIONS *****************************************************************/
 
@@ -27,7 +27,7 @@ WsProcInitialize(IN PWSPROCESS Process)
     HKEY RootKey = NULL;
 
     /* Initialize the thread list lock */
-    InitializeCriticalSection((LPCRITICAL_SECTION)&Process->ThreadLock);
+    InitializeCriticalSection(&Process->ThreadLock);
     Process->LockReady = TRUE;
 
     /* Open the Winsock Key */
@@ -295,7 +295,7 @@ WsProcDelete(IN PWSPROCESS Process)
     }
 
     /* Delete the thread lock */
-    DeleteCriticalSection((LPCRITICAL_SECTION)&Process->ThreadLock);
+    DeleteCriticalSection(&Process->ThreadLock);
 }
 
 VOID
index afd334e..4ab303b 100644 (file)
@@ -46,8 +46,8 @@ WsTpInitialize(IN PTPROVIDER Provider,
     DPRINT("WsTpInitialize: %p, %p, %p\n", Provider, DllName, ProtocolInfo);
     
     /* Clear the tables */
-    RtlZeroMemory(&Provider->UpcallTable, sizeof(WSPUPCALLTABLE));
-    RtlZeroMemory(&Provider->Service.lpWSPAccept, sizeof(WSPPROC_TABLE));
+    RtlZeroMemory(&Provider->UpcallTable, sizeof(Provider->UpcallTable));
+    RtlZeroMemory(&Provider->Service, sizeof(Provider->Service));
 
     /* Set up the Upcall Table */
     Provider->UpcallTable.lpWPUCloseEvent = WPUCloseEvent;
@@ -88,7 +88,7 @@ WsTpInitialize(IN PTPROVIDER Provider,
                       &WspData,
                       ProtocolInfo,
                       Provider->UpcallTable,
-                      (LPWSPPROC_TABLE)&Provider->Service.lpWSPAccept);
+                      &Provider->Service);
 
     /* Return */
     return ErrorCode;
index 75640b1..c0040f6 100644 (file)
@@ -413,7 +413,7 @@ gethostname(OUT char FAR * name,
     if(Name)
     {
         /* Copy it */
-        strncpy((LPSTR)name, Name, namelen-1);
+        strncpy(name, Name, namelen-1);
     }
 
     /* Check if we received a newly allocated buffer; free it. */
index 57dd8f1..bc6111c 100644 (file)
@@ -15,8 +15,8 @@
 
 /* DATA **********************************************************************/
 
-#define WsNcLock()          EnterCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
-#define WsNcUnlock()        LeaveCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
+#define WsNcLock()          EnterCriticalSection(&Catalog->Lock);
+#define WsNcUnlock()        LeaveCriticalSection(&Catalog->Lock);
 
 /* FUNCTIONS *****************************************************************/
 
@@ -48,7 +48,7 @@ WsNcOpen(IN PNSCATALOG Catalog,
     CHAR* CatalogKeyName;
 
     /* Initialize the catalog lock and namespace list */
-    InitializeCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
+    InitializeCriticalSection(&Catalog->Lock);
     InitializeListHead(&Catalog->CatalogList);
 
     /* Read the catalog name */
@@ -638,7 +638,7 @@ WsNcDelete(IN PNSCATALOG Catalog)
 
     /* Release and delete the lock */
     WsNcUnlock();
-    DeleteCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
+    DeleteCriticalSection(&Catalog->Lock);
 
     /* Delete the object */
     HeapFree(WsSockHeap, 0, Catalog);
index 5f84883..6568cf6 100644 (file)
@@ -120,7 +120,7 @@ WsNpInitialize(IN PNS_PROVIDER Provider,
     }
 
     /* Call it */
-    (*NSPStartupProc)(ProviderId, (LPNSP_ROUTINE)&Provider->Service.cbSize);
+    (*NSPStartupProc)(ProviderId, &Provider->Service);
 
     /* Save the provider ID */
     Provider->ProviderId = *ProviderId;
index 2019faf..adf6801 100644 (file)
@@ -12,8 +12,8 @@
 
 /* DATA **********************************************************************/
 
-#define WsNqLock()      EnterCriticalSection((LPCRITICAL_SECTION)&NsQuery->Lock);
-#define WsNqUnlock()    LeaveCriticalSection((LPCRITICAL_SECTION)&NsQuery->Lock);
+#define WsNqLock()      EnterCriticalSection(&NsQuery->Lock);
+#define WsNqUnlock()    LeaveCriticalSection(&NsQuery->Lock);
 
 /* FUNCTIONS *****************************************************************/
 
@@ -40,7 +40,7 @@ WSAAPI
 WsNqInitialize(IN PNSQUERY Query)
 {
     /* Initialize the lock */
-    InitializeCriticalSection((LPCRITICAL_SECTION)&Query->Lock);
+    InitializeCriticalSection(&Query->Lock);
 
     /* Set initial reference count and signature */
     Query->RefCount = 1;
@@ -92,7 +92,7 @@ WsNqDelete(IN PNSQUERY NsQuery)
 
     /* Remove the signature and delete the lock */
     NsQuery->Signature = ~0xBEADFACE;
-    DeleteCriticalSection((LPCRITICAL_SECTION)&NsQuery->Lock);
+    DeleteCriticalSection(&NsQuery->Lock);
 
     /* Free us */
     HeapFree(WsSockHeap, 0, NsQuery);
index e80316e..ad08453 100644 (file)
@@ -17,7 +17,7 @@
 
 LPSTR
 WSAAPI
-AnsiDupFromUnicode(IN LPWSTR UnicodeString)
+AnsiDupFromUnicode(IN LPCWSTR UnicodeString)
 {
     INT Length = 0;
     BOOL GoOn = TRUE;
@@ -65,7 +65,7 @@ AnsiDupFromUnicode(IN LPWSTR UnicodeString)
 
 LPWSTR
 WSAAPI
-UnicodeDupFromAnsi(IN LPSTR AnsiString)
+UnicodeDupFromAnsi(IN LPCSTR AnsiString)
 {
     INT Length = 0;
     BOOL GoOn = TRUE;