Commit 4a5f61bb authored by Jan Zerebecki's avatar Jan Zerebecki Committed by Alexandre Julliard

netapi32: Add DebugInfo to critical sections.

parent aaf9a151
...@@ -62,6 +62,7 @@ struct NBCmdQueue *NBCmdQueueCreate(HANDLE heap) ...@@ -62,6 +62,7 @@ struct NBCmdQueue *NBCmdQueueCreate(HANDLE heap)
{ {
queue->heap = heap; queue->heap = heap;
InitializeCriticalSection(&queue->cs); InitializeCriticalSection(&queue->cs);
queue->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NBCmdQueue.cs");
queue->head = NULL; queue->head = NULL;
} }
return queue; return queue;
...@@ -193,6 +194,7 @@ void NBCmdQueueDestroy(struct NBCmdQueue *queue) ...@@ -193,6 +194,7 @@ void NBCmdQueueDestroy(struct NBCmdQueue *queue)
if (queue) if (queue)
{ {
NBCmdQueueCancelAll(queue); NBCmdQueueCancelAll(queue);
queue->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&queue->cs); DeleteCriticalSection(&queue->cs);
HeapFree(queue->heap, 0, queue); HeapFree(queue->heap, 0, queue);
} }
......
...@@ -104,6 +104,7 @@ struct NBNameCache *NBNameCacheCreate(HANDLE heap, DWORD entryExpireTimeMS) ...@@ -104,6 +104,7 @@ struct NBNameCache *NBNameCacheCreate(HANDLE heap, DWORD entryExpireTimeMS)
{ {
cache->heap = heap; cache->heap = heap;
InitializeCriticalSection(&cache->cs); InitializeCriticalSection(&cache->cs);
cache->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NBNameCache.cs");
cache->entryExpireTimeMS = entryExpireTimeMS; cache->entryExpireTimeMS = entryExpireTimeMS;
cache->head = NULL; cache->head = NULL;
} }
...@@ -204,6 +205,7 @@ void NBNameCacheDestroy(struct NBNameCache *cache) ...@@ -204,6 +205,7 @@ void NBNameCacheDestroy(struct NBNameCache *cache)
{ {
if (cache) if (cache)
{ {
cache->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&cache->cs); DeleteCriticalSection(&cache->cs);
while (cache->head) while (cache->head)
NBNameCacheUnlinkNode(cache, &cache->head); NBNameCacheUnlinkNode(cache, &cache->head);
......
...@@ -1050,6 +1050,7 @@ static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess) ...@@ -1050,6 +1050,7 @@ static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess)
{ {
session->fd = fd; session->fd = fd;
InitializeCriticalSection(&session->cs); InitializeCriticalSection(&session->cs);
session->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NetBTSession.cs");
*sess = session; *sess = session;
} }
else else
...@@ -1243,6 +1244,7 @@ static UCHAR NetBTHangup(void *adapt, void *sess) ...@@ -1243,6 +1244,7 @@ static UCHAR NetBTHangup(void *adapt, void *sess)
closesocket(session->fd); closesocket(session->fd);
session->fd = INVALID_SOCKET; session->fd = INVALID_SOCKET;
session->bytesPending = 0; session->bytesPending = 0;
session->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&session->cs); DeleteCriticalSection(&session->cs);
HeapFree(GetProcessHeap(), 0, session); HeapFree(GetProcessHeap(), 0, session);
......
...@@ -104,6 +104,7 @@ void NetBIOSInit(void) ...@@ -104,6 +104,7 @@ void NetBIOSInit(void)
{ {
memset(&gNBTable, 0, sizeof(gNBTable)); memset(&gNBTable, 0, sizeof(gNBTable));
InitializeCriticalSection(&gNBTable.cs); InitializeCriticalSection(&gNBTable.cs);
gNBTable.cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NetBIOSAdapterTable.cs");
} }
void NetBIOSShutdown(void) void NetBIOSShutdown(void)
...@@ -122,6 +123,7 @@ void NetBIOSShutdown(void) ...@@ -122,6 +123,7 @@ void NetBIOSShutdown(void)
if (gTransports[i].transport.cleanup) if (gTransports[i].transport.cleanup)
gTransports[i].transport.cleanup(); gTransports[i].transport.cleanup();
LeaveCriticalSection(&gNBTable.cs); LeaveCriticalSection(&gNBTable.cs);
gNBTable.cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&gNBTable.cs); DeleteCriticalSection(&gNBTable.cs);
HeapFree(GetProcessHeap(), 0, gNBTable.table); HeapFree(GetProcessHeap(), 0, gNBTable.table);
} }
...@@ -210,6 +212,7 @@ BOOL NetBIOSRegisterAdapter(ULONG transport, DWORD ifIndex, void *data) ...@@ -210,6 +212,7 @@ BOOL NetBIOSRegisterAdapter(ULONG transport, DWORD ifIndex, void *data)
gNBTable.table[i].impl.data = data; gNBTable.table[i].impl.data = data;
gNBTable.table[i].cmdQueue = NBCmdQueueCreate(GetProcessHeap()); gNBTable.table[i].cmdQueue = NBCmdQueueCreate(GetProcessHeap());
InitializeCriticalSection(&gNBTable.table[i].cs); InitializeCriticalSection(&gNBTable.table[i].cs);
gNBTable.table[i].cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": NetBIOSAdapterTable.NetBIOSAdapter.cs");
gNBTable.table[i].enabled = TRUE; gNBTable.table[i].enabled = TRUE;
ret = TRUE; ret = TRUE;
} }
...@@ -246,6 +249,7 @@ static void nbShutdownAdapter(NetBIOSAdapter *adapter) ...@@ -246,6 +249,7 @@ static void nbShutdownAdapter(NetBIOSAdapter *adapter)
if (adapter->transport->cleanupAdapter) if (adapter->transport->cleanupAdapter)
adapter->transport->cleanupAdapter(adapter->impl.data); adapter->transport->cleanupAdapter(adapter->impl.data);
NBCmdQueueDestroy(adapter->cmdQueue); NBCmdQueueDestroy(adapter->cmdQueue);
adapter->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&adapter->cs); DeleteCriticalSection(&adapter->cs);
memset(adapter, 0, sizeof(NetBIOSAdapter)); memset(adapter, 0, sizeof(NetBIOSAdapter));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment