netapi32: Add DebugInfo to critical sections.

This commit is contained in:
Jan Zerebecki 2007-03-10 22:09:30 +01:00 committed by Alexandre Julliard
parent aaf9a151c1
commit 4a5f61bb63
4 changed files with 10 additions and 0 deletions

View File

@ -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);
}

View File

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

View File

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

View File

@ -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));
}