- Fix ridiculous over-casting

svn path=/trunk/; revision=73840
This commit is contained in:
Thomas Faber 2017-02-19 12:05:48 +00:00
parent c60757b725
commit 8b8c1c7e5a
12 changed files with 37 additions and 36 deletions

View 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

View 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 */

View 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);

View 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);

View 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)
{

View 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

View 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;

View 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. */

View 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);

View 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;

View 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);

View 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;