2008-04-07

25 new messages in 12 topics - digest

microsoft.public.development.device.drivers
http://groups.google.com/group/microsoft.public.development.device.drivers?hl=en

microsoft.public.development.device.drivers@googlegroups.com

Today's topics:

* DeviceIoControl returning ERROR_INVALID_PARAMETER - 5 messages, 3 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/e77671298696bb8f?hl=en
* QoS API for packet scheduler - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/5ce01c15b1c5952c?hl=en
* File System Hook - 2 messages, 2 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/8bd85e79bb10ae4f?hl=en
* The problem of NdisAllocateBuffer In VMWare - 4 messages, 2 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/f4745546f672b3eb?hl=en
* Cannot capture Audio in AMCap - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/e2a13e75178be39a?hl=en
* Default disk to "Optimize for quick removal" - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/6636dcdfac41c166?hl=en
* Determining a virtual COM port of an USB device - 2 messages, 2 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/7ced944dc5159c9d?hl=en
* DDK 3790 question - 4 messages, 2 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/0d65994781e47ed8?hl=en
* Custom bluetooth commands over winsock2 - 2 messages, 2 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/d87c729e0e736312?hl=en
* MS Bluetooth Stack: obtaining a remote device's friendly name - 1 messages,
1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/ff2097a68e204897?hl=en
* Is parsing the HID report manully a right decision in my case? - 1 messages,
1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/93225232f7486749?hl=en
* Vista Error Message - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/674d39469923bbb9?hl=en

==============================================================================
TOPIC: DeviceIoControl returning ERROR_INVALID_PARAMETER
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/e77671298696bb8f?hl=en
==============================================================================

== 1 of 5 ==
Date: Mon, Apr 7 2008 12:07 am
From: mooni


Hi all,

I got handle of my USB disk using following instruction.
handle = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);

I am getting this handle successfully. The problem I was facing previously
was that my ISR was not getting invoked on attaching USB disk. What I did, I
checked the registry values and found out that I was passing wrong GUID in
notification filter. Just to tell you I was passing {0xc5e4c602, 0xa413,
0x4caa, {0x9b, 0xbd, 0x2e, 0x35, 0x4c, 0x1b, 0xdd, 0xfc}} which was not
working.

I then had to look in registery that when I plug in my device it is
registered at some other Interface GUID which is {0xa5dcbf10, 0x6530, 0x11d2,
{0x90, 0x1f, 0x00, 0xc0, 0x4f, 0xb9, 0x51, 0xed}}.

Now when I set this value in notification filter and then pass this
notification filter to RegisterDeviceNotification I get ISR invoked
successfully.

But now the problem is that when I call DeviceIoControl method as shown
below it returns error. I've checked the error code and it is returning error
number 87 which means invalid parameter. code snippet is below

unsigned int usb_get_last_status(libusb_usb_dev_handle *dev)
{
usb_context_t ctx;
unsigned int ret = 0;
DWORD err = 0;
unsigned int status = 0xfffffffe;

memset(&ctx, 0, sizeof(usb_context_t));
ctx.dev = dev;
ctx.control_code = LIBUSB_IOCTL_USBD_STATUS_READ;
ctx.ol.Offset = 0;
ctx.ol.OffsetHigh = 0;
ctx.ol.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);

if(ctx.ol.hEvent)
{
ResetEvent(ctx.ol.hEvent);
if(!DeviceIoControl(ctx.dev->impl_info,
ctx.control_code,&ctx.req,sizeof(ctx.req),
&status,
sizeof(status),
&ret,
&ctx.ol))
{
err = GetLastError();
}

..........................
Can anyone tell me the reason of it and any solution to the problem?

== 2 of 5 ==
Date: Mon, Apr 7 2008 6:27 am
From: chris.aseltine@gmail.com


On Apr 7, 2:07 am, mooni <mo...@discussions.microsoft.com> wrote:

> I got handle of my USB disk using following instruction.
> handle = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING,
> FILE_ATTRIBUTE_NORMAL, NULL);
>
> I am getting this handle successfully. The problem I was facing previously
> was that my ISR was not getting invoked on attaching USB disk. What I did, I
> checked the registry values and found out that I was passing wrong GUID in
> notification filter. Just to tell you I was passing {0xc5e4c602, 0xa413,
> 0x4caa, {0x9b, 0xbd, 0x2e, 0x35, 0x4c, 0x1b, 0xdd, 0xfc}} which was not
> working.

I have no idea what that GUID is. Is it some sort of libusb device
interface? If so, maybe that explains why your IOCTL is failing --
libusb isn't really loaded, because you're not getting the device
interface arrival.

> I then had to look in registery that when I plug in my device it is
> registered at some other Interface GUID which is {0xa5dcbf10, 0x6530, 0x11d2,
> {0x90, 0x1f, 0x00, 0xc0, 0x4f, 0xb9, 0x51, 0xed}}.

This is registered by the USB stack for all USB devices. It's not
native to USB disk drives.

> But now the problem is that when I call DeviceIoControl method as shown
> below it returns error. I've checked the error code and it is returning error
> number 87 which means invalid parameter. code snippet is below
>
> ctx.control_code = LIBUSB_IOCTL_USBD_STATUS_READ;

I'm not familiar with how libusb works, but something tells me you
might not be able to send a libusb IOCTL to a USB drive which already
has a driver loaded for it (usbstor).

== 3 of 5 ==
Date: Mon, Apr 7 2008 7:47 am
From: mooni


Chris,

Thanks for your reply. Please see my comments

"chris.aseltine@gmail.com" wrote:

> On Apr 7, 2:07 am, mooni <mo...@discussions.microsoft.com> wrote:
>
> > I got handle of my USB disk using following instruction.
> > handle = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING,
> > FILE_ATTRIBUTE_NORMAL, NULL);
> >
> > I am getting this handle successfully. The problem I was facing previously
> > was that my ISR was not getting invoked on attaching USB disk. What I did, I
> > checked the registry values and found out that I was passing wrong GUID in
> > notification filter. Just to tell you I was passing {0xc5e4c602, 0xa413,
> > 0x4caa, {0x9b, 0xbd, 0x2e, 0x35, 0x4c, 0x1b, 0xdd, 0xfc}} which was not
> > working.
>
> I have no idea what that GUID is. Is it some sort of libusb device
> interface? If so, maybe that explains why your IOCTL is failing --
> libusb isn't really loaded, because you're not getting the device
> interface arrival.
>

No actually I am successfully getting device interface arrival. Actually on
arrival I call this createFile and after this I called DeviceIoControl. I've
written a test code, just to make things look abit simple. Please see below

#include <windows.h>
#include <SetupAPI.h>
#include<Dbt.h>
#include "usb.h" // come with libusb
#include "driver_api.h" // come with libusb

#define LIBUSB_DEVICE_NAME "\\\\.\\libusb0-"

const char g_szClassName[] = "myWindowClass";
static HDEVNOTIFY hdevnotify;
//static GUID GUID_CLASS_VHCTRL = {0xc5e4c602, 0xa413, 0x4caa, {0x9b, 0xbd,
0x2e, 0x35, 0x4c, 0x1b, 0xdd, 0xfc}};
static GUID GUID_CLASS_VHCTRL = {0xa5dcbf10, 0x6530, 0x11d2, {0x90, 0x1f,
0x00, 0xc0, 0x4f, 0xb9, 0x51, 0xed}};


void checkit(WPARAM);
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_LBUTTONDOWN:
{
char szFileName[MAX_PATH];
HINSTANCE hInstance = GetModuleHandle(NULL);

printf("Hello");
GetModuleFileName(hInstance, szFileName, MAX_PATH);
MessageBox(hwnd, szFileName, "This program is:", MB_OK |
MB_ICONINFORMATION);
}
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DEVICECHANGE:
MessageBox(hwnd,"Hello","Welcome",MB_OK);
printf("Hello I am Taimoor");
checkit(wParam);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}


void main()
{
HDEVINFO temp;
initDev1();
while(1);
}

DWORD WINAPI ThreadFunc (void* param)
{
MSG Msg;
WNDCLASSEX wc;
HWND hwnd;
DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
DWORD ret;

wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = NULL;//hInstance;
wc.hIcon = NULL;//LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = NULL;//LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
wc.hIconSm = NULL;//LoadIcon(NULL, IDI_APPLICATION);

if(!RegisterClassEx(&wc))
{
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}

hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"The title of my window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
NULL, NULL, NULL/*hInstance*/, NULL);

if(hwnd == NULL)
{
MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
if(hwnd)
{
ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
NotificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
NotificationFilter.dbcc_classguid = GUID_CLASS_VHCTRL;


hdevnotify = RegisterDeviceNotification(
hwnd,
&NotificationFilter,
DEVICE_NOTIFY_WINDOW_HANDLE);

}

if(!hdevnotify)
{
ret = GetLastError();
}

while(GetMessage(&Msg, hwnd, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
printf("I am out of loop");
}

int initDev1()
{
DWORD dwError;
DWORD threadId;
HANDLE hThread;

hThread = CreateThread(NULL, 0, ThreadFunc, NULL,
0, &threadId);
return 0;
}

void checkit(WPARAM wp)
{
HANDLE hand;
char dev_name[512];
int i;
DWORD derr;

libusb_request req;
OVERLAPPED ol;
unsigned int ret = 0;
unsigned int status = 0xfffffffe;

HDEVINFO dev_info;

if(wp == DBT_DEVICEARRIVAL)
printf("Device arrived");
else
printf("Device Detached");

for(i = 1; i < 256; i++)
{
_snprintf(dev_name, sizeof(dev_name) - 1,"%s%04d",
LIBUSB_DEVICE_NAME, i);

hand = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);

if(hand != INVALID_HANDLE_VALUE)
printf("Got the handle");
else
derr = GetLastError();

ol.Offset = 0;
ol.OffsetHigh = 0;
ol.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);

if(!DeviceIoControl(hand,LIBUSB_IOCTL_USBD_STATUS_READ,&req,
sizeof(req),&status,sizeof(status),&ret, &ol))
printf("Error in DeviceIoControl");
derr = GetLastError();

}
}


== 4 of 5 ==
Date: Mon, Apr 7 2008 7:49 am
From: HRcrestron


I am looking for a WDK software develper for a FT perm position in northern
NJ. Would you be interested? Please contact me a bblum@crestron.com

"mooni" wrote:

> Hi all,
>
> I got handle of my USB disk using following instruction.
> handle = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING,
> FILE_ATTRIBUTE_NORMAL, NULL);
>
> I am getting this handle successfully. The problem I was facing previously
> was that my ISR was not getting invoked on attaching USB disk. What I did, I
> checked the registry values and found out that I was passing wrong GUID in
> notification filter. Just to tell you I was passing {0xc5e4c602, 0xa413,
> 0x4caa, {0x9b, 0xbd, 0x2e, 0x35, 0x4c, 0x1b, 0xdd, 0xfc}} which was not
> working.
>
> I then had to look in registery that when I plug in my device it is
> registered at some other Interface GUID which is {0xa5dcbf10, 0x6530, 0x11d2,
> {0x90, 0x1f, 0x00, 0xc0, 0x4f, 0xb9, 0x51, 0xed}}.
>
> Now when I set this value in notification filter and then pass this
> notification filter to RegisterDeviceNotification I get ISR invoked
> successfully.
>
> But now the problem is that when I call DeviceIoControl method as shown
> below it returns error. I've checked the error code and it is returning error
> number 87 which means invalid parameter. code snippet is below
>
> unsigned int usb_get_last_status(libusb_usb_dev_handle *dev)
> {
> usb_context_t ctx;
> unsigned int ret = 0;
> DWORD err = 0;
> unsigned int status = 0xfffffffe;
>
> memset(&ctx, 0, sizeof(usb_context_t));
> ctx.dev = dev;
> ctx.control_code = LIBUSB_IOCTL_USBD_STATUS_READ;
> ctx.ol.Offset = 0;
> ctx.ol.OffsetHigh = 0;
> ctx.ol.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
>
> if(ctx.ol.hEvent)
> {
> ResetEvent(ctx.ol.hEvent);
> if(!DeviceIoControl(ctx.dev->impl_info,
> ctx.control_code,&ctx.req,sizeof(ctx.req),
> &status,
> sizeof(status),
> &ret,
> &ctx.ol))
> {
> err = GetLastError();
> }
>
> ..........................
> Can anyone tell me the reason of it and any solution to the problem?
>

== 5 of 5 ==
Date: Mon, Apr 7 2008 7:51 am
From: HRcrestron


I am looking for a WDK software develper for a ft perm position in northern
NJ. Would you be interested. Please contact me at bblum@crestron.com

"chris.aseltine@gmail.com" wrote:

> On Apr 7, 2:07 am, mooni <mo...@discussions.microsoft.com> wrote:
>
> > I got handle of my USB disk using following instruction.
> > handle = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING,
> > FILE_ATTRIBUTE_NORMAL, NULL);
> >
> > I am getting this handle successfully. The problem I was facing previously
> > was that my ISR was not getting invoked on attaching USB disk. What I did, I
> > checked the registry values and found out that I was passing wrong GUID in
> > notification filter. Just to tell you I was passing {0xc5e4c602, 0xa413,
> > 0x4caa, {0x9b, 0xbd, 0x2e, 0x35, 0x4c, 0x1b, 0xdd, 0xfc}} which was not
> > working.
>
> I have no idea what that GUID is. Is it some sort of libusb device
> interface? If so, maybe that explains why your IOCTL is failing --
> libusb isn't really loaded, because you're not getting the device
> interface arrival.
>
> > I then had to look in registery that when I plug in my device it is
> > registered at some other Interface GUID which is {0xa5dcbf10, 0x6530, 0x11d2,
> > {0x90, 0x1f, 0x00, 0xc0, 0x4f, 0xb9, 0x51, 0xed}}.
>
> This is registered by the USB stack for all USB devices. It's not
> native to USB disk drives.
>
> > But now the problem is that when I call DeviceIoControl method as shown
> > below it returns error. I've checked the error code and it is returning error
> > number 87 which means invalid parameter. code snippet is below
> >
> > ctx.control_code = LIBUSB_IOCTL_USBD_STATUS_READ;
>
> I'm not familiar with how libusb works, but something tells me you
> might not be able to send a libusb IOCTL to a USB drive which already
> has a driver loaded for it (usbstor).
>


==============================================================================
TOPIC: QoS API for packet scheduler
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/5ce01c15b1c5952c?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Apr 7 2008 2:54 am
From: "Volodymyr M. Shcherbyna"


Probably, these posts will be valuable for you:

http://blogs.msdn.com/wndp/archive/tags/QoS/default.aspx

--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Angie" <kimojolin@yahoo.com> wrote in message
news:%23FAsk%23rlIHA.5160@TK2MSFTNGP05.phx.gbl...
>I am reading the Traffic Control API. I am not sure that those APIs can
>help or not.
>
> "Pavel A." <pavel_a@NOwritemeNO.com> wrote in message
> news:O2uIEJqlIHA.1204@TK2MSFTNGP03.phx.gbl...
>> "Angie" <kimojolin@yahoo.com> wrote in message
>> news:uo3sZrplIHA.1164@TK2MSFTNGP02.phx.gbl...
>>> All,
>>>
>>> I find one problem with the Netmeeting running on the WAN adapter
>>> when the packet scheduler is enabled.
>>>
>>> The problem I found as follows.
>>> During the conversation session(voice data is transmiting), if I
>>> send a ping packet to the peer, the ICMP echo packets are blocked by the
>>> packet scheduler when
>>> they are received. By running theWireShark to capture the
>>> packets, I can see the ICMP echo packets there. However, ping test
>>> cannot go througth.
>>
>> Are you sure that packet scheduler blocks any packets on receiving side?
>> AFAIK it deals only on the sending direction.
>>
>> --PA
>>
>>
>>> If I disable the packet scheduler, the problem is solved.
>>>
>>> Is there anyone who knows what QoS API in windws that I can call
>>> to control the packet scheduler programatically?
>>>
>>>
>>>
>
>



==============================================================================
TOPIC: File System Hook
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/8bd85e79bb10ae4f?hl=en
==============================================================================

== 1 of 2 ==
Date: Mon, Apr 7 2008 3:29 am
From: "Maxim S. Shatskih"


>I think you don't need FSD filter or minifilter driver.
>You maybe need a SSDT hook driver.

Will not work on x64 Vista/2008, also note that NtReadFile hook will not catch
paging IO.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

== 2 of 2 ==
Date: Mon, Apr 7 2008 3:51 am
From: "Don Burn"


Using a SSDT hook driver for this is incredibly irresponsible. First as Max
pointed out, it will not work for X64, and it will not catch paging I/O.
Also, getting these right is harder than one thinks, and is likely to
destabilize the system. Also, the driver will immediately be flagged as
MALWARE. Following such a path for file operations that are easily
catchable with approved ways, is beyond stupid.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"doskey" <doskey.lee@gmail.com> wrote in message:

I think you don't need FSD filter or minifilter driver.
You maybe need a SSDT hook driver. You can hook some native API such
as NtCreateFile, NtWriteFile and NtReadFile.
I think it can do this case. :)



==============================================================================
TOPIC: The problem of NdisAllocateBuffer In VMWare
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/f4745546f672b3eb?hl=en
==============================================================================

== 1 of 4 ==
Date: Mon, Apr 7 2008 3:32 am
From: "Maxim S. Shatskih"


> know why, eventhought I lower the IRQL. In addition,
> NdisAllocateBufferPool
> return Successful, but the return pool handle is NULL.

This is normal, buffer pools are non-op in NT, they were only used in Win9x/Me.

In NT, NDIS_BUFFER is MDL, NdisAllocateBuffer is
IoAllocateMdl+MmBuildMdlForNonPagedPool, and NdisFreeBuffer is IoFreeMdl.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

== 2 of 4 ==
Date: Mon, Apr 7 2008 7:52 am
From: HRcrestron

I am looking for a WDK software develper for a ft perm position in northern
NJ. Would you be interested. Please contact me at bblum@crestron.com

"havegone" wrote:

>
> Hi
> Now, I want to construct my own icmp packet in IM, but when the
> driver running to NdisAllocateBuffer, the computer shut down at once,
> the blue screen output the message is DRIVER_LESS_OR_EQUAL_IRQL. I donot
> know why, eventhought I lower the IRQL. In addition,
> NdisAllocateBufferPool
> return Successful, but the return pool handle is NULL.
>
>
>
> --
> havegone
> ------------------------------------------------------------------------
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------
>
>

== 3 of 4 ==
Date: Mon, Apr 7 2008 7:53 am
From: HRcrestron


I am looking for a WDK software develper for a ft perm position in northern
NJ. Would you be interested? Please contact me at bblum@crestron.com

"Maxim S. Shatskih" wrote:

> > know why, eventhought I lower the IRQL. In addition,
> > NdisAllocateBufferPool
> > return Successful, but the return pool handle is NULL.
>
> This is normal, buffer pools are non-op in NT, they were only used in Win9x/Me.
>
> In NT, NDIS_BUFFER is MDL, NdisAllocateBuffer is
> IoAllocateMdl+MmBuildMdlForNonPagedPool, and NdisFreeBuffer is IoFreeMdl.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>

== 4 of 4 ==
Date: Mon, Apr 7 2008 7:53 am
From: HRcrestron

I am looking for a WDK software develper for a ft perm position in northern
NJ. Would you be interested. Please contact me at bblum@crestron.com
"PCAUSA" wrote:

> On Apr 6, 11:27 pm, havegone <havegone.37h...@mail.codecomments.com>
> wrote:
> > Hi
> > Now, I want to construct my own icmp packet in IM, but when the
> > driver running to NdisAllocateBuffer, the computer shut down at once,
> > the blue screen output the message is DRIVER_LESS_OR_EQUAL_IRQL. I donot
> > know why, eventhought I lower the IRQL. In addition,
> > NdisAllocateBufferPool
> > return Successful, but the return pool handle is NULL.
> >
> > --
> > havegone
> > ------------------------------------------------------------------------
> > Posted viahttp://www.codecomments.com
> > ------------------------------------------------------------------------
>
> NdisAllocateBufferPool returns NULL on current Windows versions. So,
> that is nothing to worry about.
>
> Clearly some parameter that you are passing to NdisAllocateBuffer is
> invalid.
>
> You do understand that the fourth parameter (VirtualAddress) is an
> input to NdisAllocateBuffer. You should have allocated the virtual
> memory before making the call.
>
> You simply cannot lower IRQL ever!!! You can only raise IRQL. You can
> only call NdisAllocateBuffer when you are at IRQL <= DISPATCH_LEVEL.
>
> It is also vertain that the bug you are seeing has nothing specific to
> do with VMWare.
>
> This paper at NDIS.com may be helpful:
>
> http://ndis.com/papers/ndispacket/ndispacket1.htm
>
> Thomas F. Divine
> http://www.pcausa.com
>


==============================================================================
TOPIC: Cannot capture Audio in AMCap
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/e2a13e75178be39a?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Apr 7 2008 3:50 am
From: Imti


Hi All

I have written pin-centric avstream based driver, I can successfully
preview both the audio and video. The capture of the video was also
successful. but iam unable to capture audio through AmCap, The graph
is as follows

avstream based capture filter (Audio pin) ----->Smart Tee(capture
pin)----->AVI MUX -->file writer
avstream based capture filter (Video pin) ----->2nd Smart Tee(capture
pin)----->AVI MUX->file writer

When I drag and drop the captured file in the graphedit tool, the avi
file gets connected to the avi splitter, the avi splitter shows audio
and video pins, the video gets connected to the umedia video decoder
and gets rendered properly. Similarly the audio gets connected to the
umedia audio decoder and gets rendered properly. When I try to play it
I get a black screen for the video.

However when I connect the avi file to the uMedia Demux, it recognises
it as the H.264 format data and plays the video only successfully.

Can someone tell me what could be the issue.

Please let me know if this is the timestamp issue in the driver or
someother issue.

The process function of my driver is something like this, which fills
the timestamp value to the frames.

NTSTATUS
CCapturePin::
Process (
)
{

PAGED_CODE();

NTSTATUS Status = STATUS_SUCCESS;
PKSSTREAM_POINTER Leading;
OBJECT_ATTRIBUTES objectAttributes;

Leading = KsPinGetLeadingEdgeStreamPointer (
m_Pin,
KSSTREAM_POINTER_STATE_LOCKED
);

while(NT_SUCCESS(Status) && (Leading))

{
// read from our queue
ULONG MappingsUsed =
(m_Device->*(this->m_pfnGetDataFromDevice))(
&Leading->OffsetOut.Data,
Leading->OffsetOut.Count,
Leading->OffsetOut.Remaining
);

// update the DataUsed variable with the data filled in the
Buffer
Leading->StreamHeader->DataUsed = MappingsUsed;

if(MappingsUsed)
{
#if 1


if( (m_Clock))
{
if(m_PinIndex == 0)
{
m_AudFrameNumber++;
Leading -> StreamHeader ->Duration =
(((ULONGLONG)MappingsUsed * NANOSECONDS) /192000); //192000 = 48000 *
2

} else if(m_PinIndex == 1){
m_VidFrameNumber++;
Leading -> StreamHeader ->Duration
=m_VideoInfoHeader -> AvgTimePerFrame;
}
Leading -> StreamHeader -> PresentationTime.Numerator
=
Leading -> StreamHeader ->
PresentationTime.Denominator = 1;
Leading -> StreamHeader -> PresentationTime.Time =
m_Clock->GetTime();
Leading -> StreamHeader -> OptionsFlags =
KSSTREAM_HEADER_OPTIONSF_TIMEVALID
| KSSTREAM_HEADER_OPTIONSF_DURATIONVALID;
if(Leading->StreamHeader->Size >=
sizeof(KSSTREAM_HEADER) +
sizeof(KS_FRAME_INFO))
{
PKS_FRAME_INFO FrameInfo = reinterpret_cast
<PKS_FRAME_INFO>(Leading-
>StreamHeader + 1);
FrameInfo->ExtendedHeaderSize = sizeof
(KS_FRAME_INFO);
if(m_PinIndex == 0)
{
FrameInfo -> PictureNumber =
(LONGLONG)m_AudFrameNumber;
}else if(m_PinIndex == 1)
{
FrameInfo -> PictureNumber =
(LONGLONG)m_VidFrameNumber;
}
FrameInfo -> DropCount =
(LONGLONG)m_failureCount;

}
}

No comments: