From 4a5f61bb63ce91d46bed0f60c13bb8a5a56c23bc Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 10 Mar 2007 22:09:30 +0100 Subject: [PATCH] netapi32: Add DebugInfo to critical sections. --- dlls/netapi32/nbcmdqueue.c | 2 ++ dlls/netapi32/nbnamecache.c | 2 ++ dlls/netapi32/nbt.c | 2 ++ dlls/netapi32/netbios.c | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/dlls/netapi32/nbcmdqueue.c b/dlls/netapi32/nbcmdqueue.c index de70e6bfc9c..720826d8cc8 100644 --- a/dlls/netapi32/nbcmdqueue.c +++ b/dlls/netapi32/nbcmdqueue.c @@ -62,6 +62,7 @@ struct NBCmdQueue *NBCmdQueueCreate(HANDLE heap) { queue->heap = heap; InitializeCriticalSection(&queue->cs); + queue->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NBCmdQueue.cs"); queue->head = NULL; } return queue; @@ -193,6 +194,7 @@ void NBCmdQueueDestroy(struct NBCmdQueue *queue) if (queue) { NBCmdQueueCancelAll(queue); + queue->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&queue->cs); HeapFree(queue->heap, 0, queue); } diff --git a/dlls/netapi32/nbnamecache.c b/dlls/netapi32/nbnamecache.c index 82c10a9013b..b9ed15911c7 100644 --- a/dlls/netapi32/nbnamecache.c +++ b/dlls/netapi32/nbnamecache.c @@ -104,6 +104,7 @@ struct NBNameCache *NBNameCacheCreate(HANDLE heap, DWORD entryExpireTimeMS) { cache->heap = heap; InitializeCriticalSection(&cache->cs); + cache->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NBNameCache.cs"); cache->entryExpireTimeMS = entryExpireTimeMS; cache->head = NULL; } @@ -204,6 +205,7 @@ void NBNameCacheDestroy(struct NBNameCache *cache) { if (cache) { + cache->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&cache->cs); while (cache->head) NBNameCacheUnlinkNode(cache, &cache->head); diff --git a/dlls/netapi32/nbt.c b/dlls/netapi32/nbt.c index c09b8fa3813..27dba60a7af 100644 --- a/dlls/netapi32/nbt.c +++ b/dlls/netapi32/nbt.c @@ -1050,6 +1050,7 @@ static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess) { session->fd = fd; InitializeCriticalSection(&session->cs); + session->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NetBTSession.cs"); *sess = session; } else @@ -1243,6 +1244,7 @@ static UCHAR NetBTHangup(void *adapt, void *sess) closesocket(session->fd); session->fd = INVALID_SOCKET; session->bytesPending = 0; + session->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&session->cs); HeapFree(GetProcessHeap(), 0, session); diff --git a/dlls/netapi32/netbios.c b/dlls/netapi32/netbios.c index c104ceae0ee..3362f03a001 100644 --- a/dlls/netapi32/netbios.c +++ b/dlls/netapi32/netbios.c @@ -104,6 +104,7 @@ void NetBIOSInit(void) { memset(&gNBTable, 0, sizeof(gNBTable)); InitializeCriticalSection(&gNBTable.cs); + gNBTable.cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NetBIOSAdapterTable.cs"); } void NetBIOSShutdown(void) @@ -122,6 +123,7 @@ void NetBIOSShutdown(void) if (gTransports[i].transport.cleanup) gTransports[i].transport.cleanup(); LeaveCriticalSection(&gNBTable.cs); + gNBTable.cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&gNBTable.cs); HeapFree(GetProcessHeap(), 0, gNBTable.table); } @@ -210,6 +212,7 @@ BOOL NetBIOSRegisterAdapter(ULONG transport, DWORD ifIndex, void *data) gNBTable.table[i].impl.data = data; gNBTable.table[i].cmdQueue = NBCmdQueueCreate(GetProcessHeap()); InitializeCriticalSection(&gNBTable.table[i].cs); + gNBTable.table[i].cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NetBIOSAdapterTable.NetBIOSAdapter.cs"); gNBTable.table[i].enabled = TRUE; ret = TRUE; } @@ -246,6 +249,7 @@ static void nbShutdownAdapter(NetBIOSAdapter *adapter) if (adapter->transport->cleanupAdapter) adapter->transport->cleanupAdapter(adapter->impl.data); NBCmdQueueDestroy(adapter->cmdQueue); + adapter->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&adapter->cs); memset(adapter, 0, sizeof(NetBIOSAdapter)); }