Author: tfaber
Date: Sun Feb 19 12:05:48 2017
New Revision: 73840
URL:
http://svn.reactos.org/svn/reactos?rev=73840&view=rev
Log:
[WS2_32]
- Fix ridiculous over-casting
Modified:
trunk/reactos/dll/win32/ws2_32/inc/ws2_32p.h
trunk/reactos/dll/win32/ws2_32/src/addrinfo.c
trunk/reactos/dll/win32/ws2_32/src/async.c
trunk/reactos/dll/win32/ws2_32/src/dcatalog.c
trunk/reactos/dll/win32/ws2_32/src/dcatitem.c
trunk/reactos/dll/win32/ws2_32/src/dprocess.c
trunk/reactos/dll/win32/ws2_32/src/dprovide.c
trunk/reactos/dll/win32/ws2_32/src/getxbyxx.c
trunk/reactos/dll/win32/ws2_32/src/nscatalo.c
trunk/reactos/dll/win32/ws2_32/src/nsprovid.c
trunk/reactos/dll/win32/ws2_32/src/nsquery.c
trunk/reactos/dll/win32/ws2_32/src/qshelpr.c
Modified: trunk/reactos/dll/win32/ws2_32/inc/ws2_32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/inc/ws2_3…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/inc/ws2_32p.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/inc/ws2_32p.h [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -98,7 +98,7 @@
DWORD UniqueId;
DWORD NextId;
HKEY CatalogKey;
- RTL_CRITICAL_SECTION Lock;
+ CRITICAL_SECTION Lock;
BOOLEAN Initialized;
} TCATALOG, *PTCATALOG;
@@ -139,7 +139,7 @@
DWORD ItemCount;
DWORD UniqueId;
HKEY CatalogKey;
- RTL_CRITICAL_SECTION Lock;
+ CRITICAL_SECTION Lock;
} NSCATALOG, *PNSCATALOG;
typedef struct _NSQUERY
@@ -149,7 +149,7 @@
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 @@
HANDLE NamespaceCatalogEvent;
DWORD Version;
BOOLEAN LockReady;
- RTL_CRITICAL_SECTION ThreadLock;
+ CRITICAL_SECTION ThreadLock;
} WSPROCESS, *PWSPROCESS;
typedef struct _WSTHREAD
@@ -270,11 +270,11 @@
LPSTR
WSAAPI
-AnsiDupFromUnicode(IN LPWSTR UnicodeString);
+AnsiDupFromUnicode(IN LPCWSTR UnicodeString);
LPWSTR
WSAAPI
-UnicodeDupFromAnsi(IN LPSTR AnsiString);
+UnicodeDupFromAnsi(IN LPCSTR AnsiString);
VOID
WSAAPI
Modified: trunk/reactos/dll/win32/ws2_32/src/addrinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/addri…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/addrinfo.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/addrinfo.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -816,7 +816,7 @@
/* Convert the node name */
if (nodename)
{
- UnicodeNodeName = UnicodeDupFromAnsi((LPSTR)nodename);
+ UnicodeNodeName = UnicodeDupFromAnsi(nodename);
if (!UnicodeNodeName)
{
/* Prepare to fail */
@@ -828,7 +828,7 @@
/* Convert the servname too, if we have one */
if (servname)
{
- UnicodeServName = UnicodeDupFromAnsi((LPSTR)servname);
+ UnicodeServName = UnicodeDupFromAnsi(servname);
if (!UnicodeServName)
{
/* Prepare to fail */
Modified: trunk/reactos/dll/win32/ws2_32/src/async.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/async…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/async.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/async.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -700,8 +700,9 @@
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 @@
/* Create the thread */
ThreadHandle = CreateThread(NULL,
0,
- (LPTHREAD_START_ROUTINE)WsAsyncThread,
+ WsAsyncThread,
Context,
0,
&Tid);
Modified: trunk/reactos/dll/win32/ws2_32/src/dcatalog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/dcata…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/dcatalog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/dcatalog.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -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 @@
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 @@
PTPROVIDER Provider;
IN SOCKET NewHandle;
INT Error;
- DWORD OptionLength;
+ INT OptionLength;
PLIST_ENTRY Entry;
WSAPROTOCOL_INFOW ProtocolInfo;
DWORD UniqueId;
@@ -811,7 +811,7 @@
SOL_SOCKET,
SO_PROTOCOL_INFOW,
(PCHAR)&ProtocolInfo,
- (LPINT)&OptionLength,
+ &OptionLength,
&Error);
/* Dereference the entry and check the result */
@@ -895,7 +895,7 @@
/* Release and delete the lock */
WsTcUnlock();
- DeleteCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
+ DeleteCriticalSection(&Catalog->Lock);
/* Delete the object */
HeapFree(WsSockHeap, 0, Catalog);
Modified: trunk/reactos/dll/win32/ws2_32/src/dcatitem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/dcati…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/dcatitem.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/dcatitem.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -100,7 +100,7 @@
&RegSize);
- memcpy(CatalogEntry->DllPath, (LPCSTR)Buf, sizeof(CatalogEntry->DllPath));
+ memcpy(CatalogEntry->DllPath, Buf, sizeof(CatalogEntry->DllPath));
index = sizeof(CatalogEntry->DllPath);
if(index < RegSize)
{
Modified: trunk/reactos/dll/win32/ws2_32/src/dprocess.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/dproc…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/dprocess.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/dprocess.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -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 @@
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 @@
}
/* Delete the thread lock */
- DeleteCriticalSection((LPCRITICAL_SECTION)&Process->ThreadLock);
+ DeleteCriticalSection(&Process->ThreadLock);
}
VOID
Modified: trunk/reactos/dll/win32/ws2_32/src/dprovide.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/dprov…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/dprovide.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/dprovide.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -46,8 +46,8 @@
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 @@
&WspData,
ProtocolInfo,
Provider->UpcallTable,
- (LPWSPPROC_TABLE)&Provider->Service.lpWSPAccept);
+ &Provider->Service);
/* Return */
return ErrorCode;
Modified: trunk/reactos/dll/win32/ws2_32/src/getxbyxx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/getxb…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/getxbyxx.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/getxbyxx.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -413,7 +413,7 @@
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. */
Modified: trunk/reactos/dll/win32/ws2_32/src/nscatalo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/nscat…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/nscatalo.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/nscatalo.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -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 @@
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 @@
/* Release and delete the lock */
WsNcUnlock();
- DeleteCriticalSection((LPCRITICAL_SECTION)&Catalog->Lock);
+ DeleteCriticalSection(&Catalog->Lock);
/* Delete the object */
HeapFree(WsSockHeap, 0, Catalog);
Modified: trunk/reactos/dll/win32/ws2_32/src/nsprovid.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/nspro…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/nsprovid.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/nsprovid.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -120,7 +120,7 @@
}
/* Call it */
- (*NSPStartupProc)(ProviderId, (LPNSP_ROUTINE)&Provider->Service.cbSize);
+ (*NSPStartupProc)(ProviderId, &Provider->Service);
/* Save the provider ID */
Provider->ProviderId = *ProviderId;
Modified: trunk/reactos/dll/win32/ws2_32/src/nsquery.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/nsque…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/nsquery.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/nsquery.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -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 @@
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 @@
/* Remove the signature and delete the lock */
NsQuery->Signature = ~0xBEADFACE;
- DeleteCriticalSection((LPCRITICAL_SECTION)&NsQuery->Lock);
+ DeleteCriticalSection(&NsQuery->Lock);
/* Free us */
HeapFree(WsSockHeap, 0, NsQuery);
Modified: trunk/reactos/dll/win32/ws2_32/src/qshelpr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/qshel…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/qshelpr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/qshelpr.c [iso-8859-1] Sun Feb 19 12:05:48 2017
@@ -17,7 +17,7 @@
LPSTR
WSAAPI
-AnsiDupFromUnicode(IN LPWSTR UnicodeString)
+AnsiDupFromUnicode(IN LPCWSTR UnicodeString)
{
INT Length = 0;
BOOL GoOn = TRUE;
@@ -65,7 +65,7 @@
LPWSTR
WSAAPI
-UnicodeDupFromAnsi(IN LPSTR AnsiString)
+UnicodeDupFromAnsi(IN LPCSTR AnsiString)
{
INT Length = 0;
BOOL GoOn = TRUE;