From faa424a4f71aaf9786fa631d172c6d6ef6dfeda0 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 21 Jan 2009 21:01:11 +0000 Subject: [PATCH] DEVEL15-windows-avoid-rwevent-collision-20090121 LICENSE MIT Prevent multiple smb_Server threads from sharing the same EVENT object when they are each waiting for their own packet requests to complete. (cherry picked from commit 10ecf76d281dc90a4f83f0c45404712b62bcea8b) --- src/WINNT/afsd/smb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index e4e51f8311..37cb9549c6 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -8798,14 +8798,17 @@ void smb_Server(VOID *parmp) if (smbp->com == 0x1d) { /* Special handling for Write Raw */ raw_write_cont_t rwc; - EVENT_HANDLE rwevent; - char eventName[MAX_PATH]; smb_DispatchPacket(vcp, bufp, outbufp, ncbp, &rwc); if (rwc.code == 0) { - rwevent = thrd_CreateEvent(NULL, FALSE, FALSE, TEXT("smb_Server() rwevent")); + EVENT_HANDLE rwevent; + char eventName[MAX_PATH]; + + snprintf(eventName, "smb_Server() rwevent %d", myIdx); + rwevent = thrd_CreateEvent(NULL, FALSE, FALSE, eventName); if ( GetLastError() == ERROR_ALREADY_EXISTS ) osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName)); + ncbp->ncb_command = NCBRECV | ASYNCH; ncbp->ncb_lsn = (unsigned char) vcp->lsn; ncbp->ncb_lana_num = vcp->lana;