Changeset 95871 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jul 27, 2022 2:38:21 AM (3 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxHook
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxHook/VBoxHook.cpp
r93115 r95871 21 21 *********************************************************************************************************************************/ 22 22 #include <iprt/win/windows.h> 23 23 24 #include <VBoxHook.h> 24 25 #include <VBox/VBoxGuestLib.h> 25 26 #ifdef DEBUG 26 # include <stdio.h> 27 # include <VBox/VBoxGuest.h> 28 # include <VBox/VMMDev.h> 29 # include <iprt/string.h> 27 30 #endif 28 31 … … 184 187 185 188 #ifdef DEBUG 186 # include <VBox/VBoxGuest.h>187 # include <VBox/VMMDev.h>188 189 189 /** 190 190 * dprintf worker using VBoxGuest.sys and VMMDevReq_LogString. … … 225 225 va_list va; 226 226 va_start(va, pszFormat); 227 size_t cch = vsprintf(s_uBuf.Req.szString, pszFormat, va);227 size_t cch = RTStrPrintf(s_uBuf.Req.szString, sizeof(s_uBuf.Req.szString), pszFormat, va); 228 228 va_end(va); 229 229 … … 238 238 &cbReturned, NULL); 239 239 } 240 241 240 #endif /* DEBUG */ 242 241 -
trunk/src/VBox/Additions/WINNT/VBoxHook/testcase/tstHook.cpp
r93115 r95871 22 22 #include <iprt/win/windows.h> 23 23 #include <VBoxHook.h> 24 #include <stdio.h>25 24 26 25 27 26 int main() 28 27 { 29 printf("Enabling global hook\n"); 28 DWORD cbIgnores; 29 WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), RT_STR_TUPLE("Enabling global hook\r\n"), &cbIgnores, NULL); 30 30 31 31 HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, VBOXHOOK_GLOBAL_WT_EVENT_NAME); 32 32 33 33 VBoxHookInstallWindowTracker(GetModuleHandle("VBoxHook.dll")); 34 getchar();35 34 36 printf("Disabling global hook\n"); 35 /* wait for input. */ 36 uint8_t ch; 37 ReadFile(GetStdHandle(STD_INPUT_HANDLE), &ch, sizeof(ch), &cbIgnores, NULL); 38 39 /* disable hook. */ 40 WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), RT_STR_TUPLE("Disabling global hook\r\n"), &cbIgnores, NULL); 37 41 VBoxHookRemoveWindowTracker(); 38 42 CloseHandle(hEvent);
Note:
See TracChangeset
for help on using the changeset viewer.