hi,
I am using MSVADSimple from Microsoft WDK as my reference driver.I am able to get the instance of MSVADSimple driver but when i call DeviceIoControl method and pass the handle to it fails why?
I would like to share the code snippet as follows... -
-
//Generating the device info
-
SetupDiGetClassDevs( &KSCATEGORY_AUDIO, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE );
-
-
//Enumerating device interface
-
SetupDiEnumDeviceInterfaces(dev_info, &DeviceInfoData, &KSCATEGORY_AUDIO, i, &did);
-
-
//Getting the path to device (pdd)
-
bRes = SetupDiGetDeviceInterfaceDetail(dev_info, &did, pdd, required_size, NULL, NULL);
-
-
//Handle to the device
-
HANDLE hHandle = CreateFile( pdd->DevicePath, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
-
FILE_ATTRIBUTE_NORMAL, NULL);
-
-
//Passing the Handle
-
//PData is the Out buffer where we get the driver sending value
-
bool bRc = DeviceIoControl ( hHandle,
-
(DWORD)IOCTL_SIOCTL_METHOD_OUT_DIRECT, NULL, 0, &PData,
-
sizeof( PData), &bytesReturned, NULL );
-
-
I get correct handle from CreateFile but problem is that why DeviceIoControl fails though i get PData value whatever returned from audio driver (bytesReturned always shows a random value).Could you please suggest me what's wrong with me?
Thanks
0 1509 Sign in to post your reply or Sign up for a free account.
Similar topics
by: ewoo |
last post by:
I'm trying to write a wrapper in csharp to wrap DeviceIoControl() win32
method for IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS control code--without much
luck.
I've seen lots of examples out there for...
|
by: Jules Crown |
last post by:
Everyone,
greetings, newbee here. What I'm trying to do is to compress files on NTFS
from C#.
I've been fishing around for info and gathered the hereafter. I'd like to
know what's wrong with...
|
by: Michael Allen |
last post by:
I would like to perform something similar to the below function in C# .NET.
The C++ below code is from a Microsoft DDK sample driver application.
Specifically, I would like to perform Device I/O...
|
by: Jacky |
last post by:
Hi,
I am trying to make network card interface with VB.NET 2002.
I use DeviceIOControl-function. I have tried to define inbuffer and
outbuffer using byte array and it's pointer. The second I...
|
by: Pixie |
last post by:
I am trying to query the change journal using the deviceIOControl API. The API doesn't return an error, but all of the values in the output buffer are zero, and they shouldn't be. My code is below. I...
|
by: Pixie |
last post by:
We are successfully getting a handle to a drive using createfile then using that handle to query the change journal using DeviceIOControl with the paramter FSCTL_QUERY_USN_DATA. However when we try...
|
by: Juan Pedro Gonzalez |
last post by:
Helo,
I'm having problems here with the input buffer.... Ive defined the API call
as:
<System.Runtime.InteropServices.DllImport("kernel32", SetLastError:=True)> _
Private Shared Function...
|
by: Lou |
last post by:
is there a VB .NET way to use the API "DeviceIoControl"?
-Lou
|
by: Andrew |
last post by:
Hello I am trying to port some code and I am running into some issues I
may or may not be able to solve on my own and would appreciate your help
Basically I am trying to open the Tun Driver...
|
by: =?Utf-8?B?TWFyaW5h?= |
last post by:
Does any know any sample of how to do a basic DeviceIoControl with something
like IOCTL_BATTERY_GETSYSTEMPOWERSTATUSEX2 in C#
I have been stuck all week :(
and google doesnt yield anything of...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |