problems with giveio in win2k

This is a discussion on problems with giveio in win2k within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, I am trying to access ports via the giveio.sys driver but I can't even open it. In Visual ...

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    7

    Question problems with giveio in win2k

    Hi all,

    I am trying to access ports via the giveio.sys driver but I can't even open it.
    In Visual C++ I built a normal Dos Box application and the routine ran fine but when I use the same stuff in my DLL, it just won't work. The CreateFile() always returns an invalid handle value:

    h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL,
    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
    if (h == INVALID_HANDLE_VALUE) {
    MessageBox(0,"Couldn't access giveio device","Error",MB_ICONHAND);
    }

    Can anybody give me a hint why this happens, why it does not work in my DLL?

    Thanks a lot!
    --mccoz
    Last edited by mccoz; 11-10-2004 at 04:17 AM.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,676
    What does GetLastError() return?

    gg

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    7
    Thanks for the hint, it returns:
    2 The system cannot find the file specified. ERROR_FILE_NOT_FOUND
    But why does the exact same code work within the dos box application? How do I have to specify the file location in the DLL?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. String Manipulation problems -_-
    By Astra in forum C Programming
    Replies: 5
    Last Post: 12-13-2006, 04:48 PM
  3. Rendering problems (DirectX?)
    By OnionKnight in forum Tech Board
    Replies: 0
    Last Post: 08-17-2006, 12:17 PM
  4. contest problems on my site
    By DavidP in forum Contests Board
    Replies: 4
    Last Post: 01-10-2004, 08:19 PM
  5. Having Problems with Win2k and Softice
    By XenoCodex Admin in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 07-01-2002, 02:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21