VirtualBox

Ignore:
Timestamp:
Jul 27, 2022 2:38:21 AM (3 years ago)
Author:
vboxsync
Message:

Add/Nt/VBoxHook: Made it build in VBOX_WITH_NOCRT_STATIC mode. bugref:10261

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxHook/testcase/tstHook.cpp

    r93115 r95871  
    2222#include <iprt/win/windows.h>
    2323#include <VBoxHook.h>
    24 #include <stdio.h>
    2524
    2625
    2726int main()
    2827{
    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);
    3030
    3131    HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, VBOXHOOK_GLOBAL_WT_EVENT_NAME);
    3232
    3333    VBoxHookInstallWindowTracker(GetModuleHandle("VBoxHook.dll"));
    34     getchar();
    3534
    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);
    3741    VBoxHookRemoveWindowTracker();
    3842    CloseHandle(hEvent);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette