CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: VxD

  1. #1
    Guest

    VxD

    I have a VxD already created and I have a C++ application already created. How do I use the VxD inside the C++ application. I can't rebuild the VxD because I don't have the code for it. What do I do???????


  2. #2
    Join Date
    May 1999
    Posts
    10

    Re: VxD

    To open VxD handle :
    hKernel32Dll = LoadLibrary( "kernel32.dll" );
    if( !hKernel32Dll )
    {
    Application->MessageBox("Cannot load Kernell32.dll event"," Error" ,MB_OK|MB_ICONSTOP);
    return 0;
    }
    pfOpenVxDHandle = ( HANDLE ( WINAPI* ) (HANDLE )) GetProcAddress( hKernel32Dll, "OpenVxDHandle" );
    if( !pfOpenVxDHandle )
    {
    Application->MessageBox("Cannot Get Address of pfOpenVxDHandle ","Mardll Error" ,MB_OK|MB_ICONSTOP);
    return 0;
    }
    hDevice = CreateFile(VxDName, 0, 0 , 0, CREATE_NEW, FILE_FLAG_DELETE_ON_CLOSE, 0);
    if (hDevice == INVALID_HANDLE_VALUE)
    {
    char serr[256];
    err = GetLastError();
    sprintf(serr, "Cannot load VxD, error=%08lx\n", err );
    Application->MessageBox(serr,"Error" ,MB_OK|MB_ICONSTOP) return 0;
    }
    FreeLibrary(hKernel32Dll);
    To call VxD procedure something like
    Success = DeviceIoControl(hDevice,
    IOCTL_GPD_SEND_BUF_WIN32, // Handle to device
    NULL, // Buffer from driver.
    0, // Length of buffer in bytes.
    sig+, // Buffer to driver.
    bSize, // Length of buffer in bytes.
    &ReturnedLength, // Bytes placed in DataBuffer.
    NULL // NULL means wait till op. completes.
    );

    and
    CloseHandle(hDevice);
    at end


  3. #3
    Join Date
    May 1999
    Posts
    11

    Re: VxD

    Can you please suggest me some books or Internet sites from where I can get started with writing VXDs for windows ?
    Actually I want to access the System Timer 8253 at the rate of 44Khz or more & trap system H/w interrupts.

    Thanx
    Surinder

    ICQ #3760 3760

  4. #4
    Join Date
    May 1999
    Posts
    25

    Re: VxD

    Hi,
    With regard to VxD books I have found the following to be useful:

    Writing Windows VxD's and Device Drivers - by Karen Hazzah
    System programming for Windows95 - by Walter Oney

    Try http://www.amazon.com the book people for more titles.

    The following sites may be useful:

    http://www.vireo.com/vireo.htm
    http://www.chsw.com/ddk/


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured