SendInput in user mode drivers?

Discussion in 'Windows Vista Drivers' started by zxli, Jan 14, 2007.

  1. zxli

    zxli Guest


    Can I use SendInput to emulate keyboard input in user mode drivers? I tried
    to send some keys but it didn't take any effects.

    INPUT inputs[2];
    inputs[0].type = INPUT_KEYBOARD;
    inputs[0].ki.wVk = VK_UP;
    inputs[0].ki.wScan = 0;
    inputs[0].ki.dwFlags = 0;
    inputs[0].ki.time = 0;
    inputs[0].ki.dwExtraInfo = 0;
    inputs[1].type = INPUT_KEYBOARD;
    inputs[1].ki.wVk = VK_UP;
    inputs[1].ki.wScan = 0;
    inputs[1].ki.dwFlags = KEYEVENTF_KEYUP;
    inputs[1].ki.time = 0;
    inputs[1].ki.dwExtraInfo = 0;
    SendInput(ARRAYSIZE(inputs), inputs, sizeof(inputs[0]));

    zxli, Jan 14, 2007
    1. Advertisements

  2. zxli

    zxli Guest

    SendInput reports error code 0x00000005(access is denied) in my user mode

    Is there any suggestion? Thanks!
    zxli, Jan 14, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.