Changeset 650 for trunk/src/user32/new/spy.cpp
- Timestamp:
- Aug 23, 1999, 5:34:47 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/spy.cpp
r374 r650 1 /* $Id: spy.cpp,v 1. 2 1999-07-23 17:52:16 sandervlExp $ */1 /* $Id: spy.cpp,v 1.3 1999-08-23 15:34:46 dengert Exp $ */ 2 2 3 3 /* … … 26 26 27 27 28 #define Q_BUFFER_SIZE 29 #define MAX_MESSAGES 28 #define Q_BUFFER_SIZE 4096 29 #define MAX_MESSAGES (Q_BUFFER_SIZE/sizeof(Q_SPYMSG)) 30 30 31 PID 32 HQUEUE 31 PID pidServer = 0; 32 HQUEUE hqQueue = 0; 33 33 Q_SPYMSG *pvdQMemory = 0; 34 int 34 int msgIndex = 0; 35 35 36 36 BOOL InitSpyQueue() … … 38 38 APIRET rc; 39 39 40 if ( rc = DosOpenQueue(&pidServer, &hqQueue, "\\queues\\"Q_NAME))40 if ((rc = DosOpenQueue(&pidServer, &hqQueue, "\\queues\\"Q_NAME)) != 0) 41 41 { 42 42 dprintf(("InitSpyQueue: couldn't open spy queue rc=%d!", rc)); 43 43 return FALSE; 44 44 } 45 if ( rc = DosAllocSharedMem((VOID **)&pvdQMemory,46 47 48 fALLOCSHR))45 if ((rc = DosAllocSharedMem((VOID **)&pvdQMemory, 46 NULL, 47 Q_BUFFER_SIZE, 48 fALLOCSHR)) != 0) 49 49 { 50 50 dprintf(("InitSpyQueue: DosAllocSharedMem failed rc=%d", rc)); … … 70 70 if(hqQueue) { 71 71 if(pvdQMemory) { 72 72 rc = DosWriteQueue(hqQueue, Q_SPYMSG_KILLSERVER, 0, 0, 0); 73 73 if(rc) { 74 74 dprintf(("CloseSpyQueue: DosWriteQueue returned %d", rc)); 75 75 } 76 76 } 77 77 DosCloseQueue(hqQueue); 78 78 } 79 79 if(pvdQMemory) 80 80 DosFreeMem(pvdQMemory); 81 81 } 82 82 … … 88 88 if (hqQueue == 0) 89 89 return FALSE; 90 90 91 91 pvdQMemory[msgIndex].hwnd = hwnd; 92 92 pvdQMemory[msgIndex].Msg = Msg; … … 94 94 pvdQMemory[msgIndex].lParam = lParam; 95 95 96 if ( rc = DosWriteQueue(hqQueue,97 98 99 100 0))96 if ((rc = DosWriteQueue(hqQueue, 97 Q_SPYMSG_WNDMSG, 98 sizeof(Q_SPYMSG), 99 &pvdQMemory[msgIndex], 100 0)) != 0) 101 101 { 102 102 hqQueue = 0; //give up, server probably died … … 104 104 return FALSE; 105 105 } 106 if(++msgIndex >= MAX_MESSAGES) 106 if(++msgIndex >= MAX_MESSAGES) 107 107 { 108 108 msgIndex = 0;
Note:
See TracChangeset
for help on using the changeset viewer.