hd audio debugging?
Hello, is there a tool available to "sniff" the data at the HD audio level to
determine what is going over the bus??
Thanks! Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79676
Hardware Found Suppression
I have a 3rd party USB device and driver install. Every device, although
different id uses the same driver and is functionaly identical.
I would like (in win xp 32) to be able to plug in a new (replacement) device
of the same type and have it work with out going through the found new
hardware wizard.
I have this working in embedded (a side product of adding the driver via
target designer?) but I need the feature to work in XP.
Where would I begin to look for this answer?
Thank you for your time ! Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79672
using checked version of XP
I am running into multiple first chance exceptions and want to install a
checked version of XP.
Apparently is there a version SP1 on the MSDN DVD but this doesn't install
over a SP2 fre version.
The downloaded version SP2 is failing as well when started in a SP2 fre
environment.
I need just some more debug information from the spoolsv.exe since I am
debugging a printer driver/language monitor.
Is there a way to just extract some needed DLL's and drop them into fre
system?
If yes, which DLL's do I need?
\Manfred Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79671
Error 1402 during install
Hello,
I recently got subscription to MSDN. This is the second time I have seen
this error while installing stuff, This time it's while installing XPsp2
SDK... which I really do need...
I get the following:
Error 1402 Could not Open Key: UNKNOWN\Microsoft.SampLink.1\CLSID
I go look for it, and for sure it's not there...
Did a search with no results... Hope someone out there has the answer, I
must not have loaded something...
Thanks,
Bill Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79667
Intercepting a key character from usb keyboard
Hey,
I have a usb keyboard, and I want to use it as an alternative inpu
device. So lets say I press an "a" on the keyboard, my program wil
intercept that "a" comming off of the usb keyboard and react to it
The trick is, I dont want the operating system to know about the "a
that was pressed. Does any one know how this is done? Can it be done i
visual basic? Do I need to write a custom driver for this?
Thanks
Nas
-
nas
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79660
IoOpenDeviceRegistryKey fails during StartDevice
Hi everybody!
I need to get data from "Device Parameters" registry key during the
StartDevice to get the number of subdevices I have to install during
this StartDevice call...
I make this call:
ntStatus = IoOpenDeviceRegistryKey(
pDeviceObject,
PLUGPLAY_REGKEY_DEVICE,
STANDARD_RIGHTS_READ,
&hKey);
... but I get a 0xc0000010 (STATUS_INVALID_DEVICE_REQUEST) error.
However pDeviceObject seems to be OK since I am able to create
subdevices later in StartDevice.
Any idea?
Many thanks!
Phil. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79652
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION not working on win2k+OHC
Dear Sir, For detecting over-current condition on USB External hub ports, I'm
using DeviceIOControl IOCTL_USB_GET_NODE_CONNECTION_INFORMATION (from
NTDDK\usbioctl.h). This IOCTL returns a called
USB_NODE_CONNECTION_INFORMATION, having an element USB_CONNECTION_STATUS.
This is an enum. One thing it reports is DeviceCausedOvercurrent &
DeviceNotEnoughPower values.
I'm creating over-current condition on USB hub by connecting multiple
devices (around 20) on 3 levels of hub.
When I connect this setup to a server having EHCI controller & Win2k SP4
installed, this IOCTL correctly reports that at certains ports of the USB
hub, value of USB_CONECTION_STATUS is DeviceCausedOvercurrent.
But, when I connect this same setup to a server having chipset with OHCI
controller & Win2k SP4, the same IOCTL gives USB_CONECTION_STATUS of
NoDeviceConnected.
Why is it that on Win2k3 with OHCI controller, the IOCTL reports correct
status of the port, but on Win2kSP4 with OHCI controller, it is not giving
correct results?
Is this the known fact? Is this with OHCI controller's driver on Win2k SP4?
How to work around this problem and get the correct status of the port?
Please guide me.
Thanks and Best Regards,
Ganesh Borse Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79651
POINTQF structure ?
Hello,
In STROBJ_bGetAdvanceWidths function there is parameter POINTQF which gives
array of POINTQF structures. I am using this function to get the width of the
glyphs in the string which I get in DrvTextOut function hook. Can anybody
tell
me how to get width of the gluph from this POINTQF structure ?. This
structure
has two LARGE_INTEGER members which are 64 bit in length and DDK MSDN says
it's
in (28.36, 28.36) format. What is this format ?
FUNCTION :
BOOL STROBJ_bGetAdvanceWidths(
IN STROBJ *pso,
IN ULONG iFirst,
IN ULONG c,
OUT POINTQF *pptqD
);
Thanks and regards Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79647
where we can capture URB data at first
I cheked kbfiltr example from WINDDK.
Can u elaborate this like where i can see the eaxct data\character
pressed from keyboard.
After loading the driver should i start noteopad n check it or throug
debugger?
What abt the filter diver which is present as a part of
windows/system32/driver/...
--
nash
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79644
NDISPROT read and speed problems.
Hi all,
I have to develop an 1 Gbps connection between our front-end board and
PC. I found that the easiest and fastest way (especially form board
development point of view) will be to use the raw Ethernet frames.
I found that NDISPROT example from DDK could almost directly be used to
send and receive raw frames. I've made some tests - just connect two PC
with onboard gigabit NICs - and got problems.
First is that the speed of the connection is about 350 Mbps and 150 Mbps
for 9k frames and 1.5k frames respectively, which is event not close to
1 Gbps. Is that problem because of the NDISPROT driver itself or the
NICs (NVIDIA nForce + Intel PRO 1000 MT) are not good enough?
Second problem is when I sending frames from the first NIC and receive
on the second no all frames are read out. Now I solve that problem just
sending another small confirmation frame back, but it is no the way
which I like. I have to mentioned that if on the receiver side I look to
"Local Area Connection Status" the number of received frames is ok, so
all have reached the receiver PC even without that confirmation frames.
Regards,
Bartek Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79641
IoAttachDevice problem
Hi,
Recently I went thru' a source code that uses IoAttachDevice function
to get the target device object.
status = IoAttachDevice (DeviceObject, TargetDeviceName,
&pDevExt->AttachedDeviceObject); // TargetDeviceName is set to
\\Device\\Video0
pDevExt->TargetDeviceObject = pDevExt->AttachedDeviceObject;
IoDetachDevice (pDevExt->AttachedDeviceObject);
IoCallDriver (pDevExt->TargetDeviceObject, ....)
But is this the right way to do that?
2. Moreover, what's the difference between
pDevExt->AttachedDeviceObject and
pDevExt->AttachedDeviceObject->DriverObject->DeviceObject in this
context?
Could someone please explain me?
Thanks
VK Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79636
DrvDocumentPropertySheet() fucntion call
Hi All,
Can anyone tell me the difference between calls to
DrvDocumentPropertySheets() from printer control panel and file/Dialog
box(Application.)
Because if it's a call from printer control panel,then all the current
settings should be saved to registry. And if its a call from file/dialog box
then current settings should be maintained through static variables.
How to identify that, the call is from control panel or application?
Thanks in advance. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79633
IoGetDeviceObjectPointer and WdfRequestGetFileObject
I am currently converting my WDM+DriverWorks drivers to KMDF.
I have two drivers. The master driver(DeviceA) uses WDM+DriverWorks.
The slave (DeviceB) has been converted to KMDF.
DeviceA uses KLowerDevice (which embedds an IoGetDeviceObjectPointer
call) to establish the connection between DeviceA and DeviceB.
IoGetDeviceObjectPointer succeeds. DeviceA then builds a
IRP_MJ_DEVICE_CONTROL itp to communicate with DeviceB. DeviceB receives
the control code but WdfRequestGetFileObject returns NULL.
If I use an user application to send the same control code to DeviceB,
WdfRequestGetFileObject returns a valid WDFILEOBJECT.
According to the KMDF documentation, WdfRequestGetFileObject will fail
if
a) Your driver has not called WdfDeviceInitSetFileObjectConfig and
specified a WDF_FILEOBJECT_CLASS value that causes the framework to
create file objects.
>> I do call WdfDeviceInitSetFileObjectConfig in my EvtDriverDeviceAdd
callback and the call does not fail when the user application runs.
b) Another driver sent a read, write, or I/O control request to your
driver without first sending a request type of WdfRequestTypeCreate.
>> I have a trace statement in EvtDeviceFileCreate and the event is firing so DeviceA is sending the WdfRequestTypeCreate.
Thanks for the help!
Chris Grove Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79626
Printer Spool File Name
In earlier versions of Windows, a printer spool name was in the form of
XXXXX.SPL.
Print Data being saved in directory \windows\system32\spool\printers.
XXXXX were 5 decimal digits, equal to the jobid found in structure
JOB_INFO_2.
In my last version of Window XP-sp2, file names are now in the form
FPXXXXX.SPL and the XXXXX value does not match any more with the "JobId".
Strangely enough, if for a specific printer "Advanced Properties", function
"Keep printed documents" is activated, the structure of printer spool name is
back to the older version (5 decimal digits = JobId).
Could somebody be so kind to tell me how to predict the Printer Spool File
Name, for a specific "JobId".
Many thanks. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79622
Easilly replace a Device Drive?
I was asked to:
1. Verify if the correct Device Driver is installed.
2. If not - replace said driver by another one.
My clientâ??s product is recognized as a â??Standard Deviceâ?? and Windows install
a default driver not working with the product. The user must install the
software first, but of course many do not read the manual ;)
The product is done, ready to deliver, so the solution needs to be somewhat
of a patch.
I have never done such low level development (mainly end-user applications,
GUI, and interfaces for DB) so I am not sure where to start;
I am trying to avoid the DDK, I am hopping for a quick solution with a
simple verification in the registry, and call some Windows API update/install
functions.
Does it make sense? Do I absolutely need the DDK? Where do I start? (A few
functions of the API usually gets me started)
Anyone can give me direction?
Thanks to all,
GG Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79618
Any solution to "error LNK2019: unresolved external symbol __imp__RtlInitUnicodeString@8"
Hi,
I have the following code:
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;
RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");
InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------
AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
eString@8 referenced in function _DrvEnablePDEV@44
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done
2 files compiled
1 executable built - 2 Errors Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79617
Get file handle to all USB storage devices
I need to get a file handle to only the USB storage drives on my system.
So, I know I need to do a Createfile("\\\\.\\PhysicalDriveX"... but, how do
I determine that PhysicalDriveX is of type USBSTOR\DISK.
I've browsed through the SetupDi functions and the devcon.exe source code,
but I don't see how I can tie the two together.
Any suggestions?
Thanks in advance...
-Brett Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79615
32 bit WinDbg on host debugging 64 bit driver on target
Hi all
Has anyone else noticed that WinDbg cannot display addresses correctly
when debugging a 64 bit target driver on a 32 bit host? Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79601
Help needed for development of SDIO drver on WinXP
Hi all,
I'm new to SDIO drivers and developing one WLAN device using Win2k3
server SP1 DDK. Is there any sample code available to jump start on the
driver development ? I've heard about the Yokogawa SDIO sniffer (or
analyzer). Where can i get it ? Any pointer is appreciated.
Regards
Esha Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79600
How to accesss memory map io register?
Hi all,
I have a problem. I have mapped my memory io register but I do not know
how to read and update a particular io register. For example:
My memory mapped io register:
offset 0 to 1 is Host control setting
offset 2 to 3 is host status
offset 4 to 5 is interrupt line
If you want to read/update offset 2 to 3, how to do in C code?
mmadd = MmUnmapIoSpace(pdx->pMmAdd, 5);
Thanks.
HS Phuah Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79599
USBD behavior on surprise removal
HI,
MYusb function driver starts an i/o operation only after the earler one
has completed i.e. the USBD has only one IRP pending at any time. Do I need
to support IRP cancellation for this scenario.
What I would like to know what happens if the user yanks out the usb device
while the IRP is being procesed by the bus driver. The active IRP gets
completed with an error status or the IRP remains pending. Does my device
object get deleted? I guess no because it still has one reference to it?
What happns if the user yanks out the device and puts it back again in a
matter of few seconds. What I sometimes see that I now have two device
objects which is something I don't want as I support only one device at a
time. What should I do to avoid have two device objects. Does cancelling
IRPs when surprise removal happens helps to solve this problem.
Please guide me to any KB article on the behavior of USBD upon surprise
removal and and an IRP active at the same time. I tried to find an exact
answer but couldn't get it in DDK.
Regds.
Nitin Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79598
How to detect USB connect or not at Windows 98/ME ?
Hi all,
My AP need to know device connect status at Windows 98/ME.
Is possible to know USB connected or not by checking Registry Key ?
Thanks for any hint. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79595
Forcing spool files to contain EMF
Hi again,
After reading some material on printers, and asking questions in
forums, I am still confused.
So I thought I might try to rephrase my question and get a better
answer.
My final goal - Get an EMF from EVERY print that is issued (on every
printer installed and from every application), analyze it, and stop or
resume the print.
I know EMF is undocumented, but these are my requirements so I want to
stick to it in the meantime.
My idea was to somehow make sure all spool files will contain EMF and
not text or RAW. (And extract the EMF from the spool file)
If I'll send all prints through a dummy printer driver (maybe I'll
change in the registry and put my printer driver for all installed
printers) which is local and always uses "Advance printing
features" (set from the code) I should accomplish this?
Is there another possibility?
After I analyze the EMF, if I decide so, I can resend the spool file to
a real printer to be printed. (Using OpenPrinter and WritePrinter).
Again, this solution has to work on both local and network printer
(eventually, I need the EMF on my system not on a remote one)
Thanks. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79594
KS filter driver fails remove data format
Hi,
I am trying to build a video capture filter driver upon on webcam WDM
driver. I need to remove some format such as MJPEG for post image
processing. Now I encountered a problem.
>From the MSDN of KS Data Formats and Data Ranges, KS filter reports all
dataformat information thru KSPROPERTY_PIN_DATARANGES and
KSPROPERTY_PIN_CONSTRAINEDDATARANGES. And clients use
KSPROPERTY_PIN_PROPOSEDATAFORMAT and KSPROPERTY_PIN_DATAINTERSECTION to
quest the format supportted status.
In IRP complete routine, I did get the stream class returned datarange
information at KSPROPERTY_PIN_DATARANGES , then I removed the format as
following
case KSPROPERTY_PIN_DATARANGES:
if(lOut){
PKSDATARANGE pDataRange;
PKS_DATARANGE_VIDEO pdataRangeVideo;
PKSMULTIPLE_ITEM pKsMI;
PKS_VIDEOINFOHEADER pKsVideoIH;
ULONG i;
// SystemBuffer is used to transfer the returned
supportted fomat.
pKsMI = (PKSMULTIPLE_ITEM) pSys;
pKsMI->Count = 5; //Note that totle color format has
10 items
pKsMI->Size = 1488;
pDataRange = (PKSDATARANGE) ((PBYTE)pKsMI +
sizeof(KSMULTIPLE_ITEM));
for(i=0; i< pKsMI->Count; i++)
{
pDataRange->Flags =
PinDefaultDataRanges[i]->Flags;
pDataRange->FormatSize =
PinDefaultDataRanges[i]->FormatSize;
pDataRange->Reserved =
PinDefaultDataRanges[i]->Reserved;
pDataRange->SampleSize =
PinDefaultDataRanges[i]->SampleSize;
memcpy(&pDataRange->MajorFormat,
&PinDefaultDataRanges[i]->MajorFormat, sizeof(GUID));
memcpy(&pDataRange->SubFormat,
&PinDefaultDataRanges[i]->SubFormat, sizeof(GUID));
memcpy(&pDataRange->Specifier,
&PinDefaultDataRanges[i]->Specifier, sizeof(GUID));
pDataRange = (PKSDATARANGE)((PBYTE) pDataRange +
pDataRange->FormatSize);
}
}
else
Irp->IoStatus.Information = 1488;
break;
In the KSPROPERTY_PIN_DATAINTERSECTION, similar modificatin is made.
But after that, amcap can not preview, it reports "Error 80004002:
Cannot find VCapture:IAMStreamConfig", followed with "This graph cannot
preview" message.
I can not found the reason for this failure. Can anyone tell me the
clue to resolve this problem? How to change the dataformat in the video
capture upper filter driver?
Thanks in advance! Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79586
STATUS_WDF_FORWARDED and KMDF 1.1
I have a driver that compiled fine under 01.00.5054, that is now giving me
grief under KMDF 1.1.
Among other things, the status STATUS_WDF_FORWARDED has disappeared.
Instead, the call to WdfRequestForwardToQueue, simply returns
STATUS_SUCCESS, if successful.
While I understand that this is consistant with a lot of the DDK, I (of
course) have conditional logic that does not complete the IRP if the request
has been successfully forwarded.
What's the best way to handle this now?
G Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79573
RDR bug?
The scenario:
1) Two different CDs with different \autorun.inf on them. In other words,
the file names are the same, the content differ.
2) Two PCs in a LAN, the server and client
3) The CD drive on the server is shared; it's just a normal share with
default settings.
4) Insert CD1 on the server.
5) Open and read \\Share\CD\autorun.inf on the client. All is OK.
6) Eject CD1, insert CD2.
7) Open and read \\Share\CD\autorun.inf. Now either CreateFile() fails with
Win32 error 34 (ERROR_WRONG _DISK), or ReadFile() returns the old content
from CD1. I can open all other files just fine, but not the files with the
same name which were opened previously. Say, if I have \setup.exe on both
CD1 and CD2, but I didn't open setup.exe at step 5, I can access CD2's
setup.exe on step 7.
How can flush the RDR cache on the client programmatically, instead of
having to reboot the server or recreate the share every time? Thanks.
A. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79568
What is the best strategy to retrieve data from video driver? I am
Hi,
I am trying to retrieve basic data from video driver via ExtEscape.
But the problem is I am getting blue screen of death.
I have a data structure
typedef struct _DispCmdQueue {
RECTL queue[2000];
INT queueHeadIndex, queueTailIndex;
INT queueSize;
} RectQueue, *PRectQueue;
In the main function I am creating a
RectQueue rectQueue;
Then I am calling the driver
ExtEscape(hdc,0,0,NULL, sizeof(rectQueue), (char *)&rectQueue);
And in the driver I am trying to set one field of the structure like that
ULONG
DrvEscape(
IN SURFOBJ *pso,
IN ULONG iEsc,
IN ULONG cjIn,
IN PVOID pvIn,
IN ULONG cjOut,
OUT PVOID pvOut)
{
PRectQueue userPRectQueue = (PRectQueue) pvOut;
userPRectQueue->queueTailIndex = 1;
}
But I am getting blue screen and machine needs reboot.
Any suggestion.
Sincerely,
Omer Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79564
Winqual: Error encountered during new submission creation
Hello
I have been trying rather unsuccessfully to create a new submission for the
last few days.
After I add the test logs I receive an error message " ...does not appear to
contain valid logs for the selected operating system"
All tests have passed and the Submission viewer doesnt not indicate any
problems either
Has anyone experienced a similar problem.... ?
Is there a problem with creating the cab files if you have a dual boot
machine .... and the OS and HCT are not installed on the C drive ?
Does the winqual site have a problem with the inf in the parent directory
and drivers for x86/x64 listed in sub directories
(e.g., Parent dir (xxx.inf)
subdir x86 (xxx.sys for x86)
subdir x64 (xxx.sys for x64)
)
Any help would be appreciated
Thanks
--rr Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79561
DevCon Sample
Hi
I am looking for sample code that makes use of the DevCon application to
enable/disable devices
I look for the following methods:
Using DevCon Classes and ListClass method to list to the user the list of
devices (not all) in a readable format
Based on the data returned from the DevCon, retrieve the device specific
data to use later to enable/disable that device (something like Hardware ID)
Thank you,
Samuel Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79558
Listening to broadcasts for a port using TDI
Hi,
I'm attempting to write a function for a kernel driver of ours that will
listen for a UDP broadcast on a specified port. I'm attempting to
communicate with a device on the network that when given a directed UDP
packet on a specified port unfortunately responds with a UDP broadcast to a
different port.
I tried to do an IoCallDriver call with an IRP created with
TdiBuildQueryInformation and a QType of TDI_QUERY_BROADCAST_ADDRESS to obtain
the broadcast address of the local-node. I get a status of STATUS_CANCELLED
returned.
I have many functions in our kernel drive that can communicate via UDP and
TCP successfully, but I can't seem to create a connection to the local
broadcast address. These functions work with abstract "Sockets". I know
there are no sockets like in WinSock2 in the kernel space, but our functions
use this concept via the IoGetDeviceObjectPointer call, etc., etc.. So I
have a function that will successfully create a "Socket" and with this
"Socket" I try to:
1. Find the local-node broadcast address via TdiBuildQueryInformation.
(Unsuccessfully.)
2. Attempt to bind to 0xFFFFFFFF and setup a TDI_EVENT_RECEIVE_DATAGRAM
event handler. I see the broadcast using Etherpeek, but the event handler is
never fired.
So I know that the code I have that creates a "Socket" works because I use
it all over the driver code and it works. However, I'm not sure if I have to
create the "Socket" a little different because I want to use it to accept
broadcasts. I know that in WinSock2 you have to open the socket and prime,
or set the broadcast option, to use broadcasts. It would seem logical that
there was some sort of priming needed in the kernel space using TDI also.
Any help on this subject would be much appreciated.
Thanks,
-David G Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79555
one more question about DEVMODE private data
Hello!
Has anybody ever used DEVMODE private data to transfer some data from one to
another module?
I found out that there are some problems. To fill private members I use the
following:
PCBUSERDATA pUserData = (PCBUSERDATA) pCallbackParam->UserData;
POEMDEV pOEMDev = (POEMDEV)pUserData->pOEMUIParam->pOEMDM;
pOEMDev->>dwDriverData = 1;
pOEMDev->>dwDriverData1 = 2;
The field dmDriverExtra of DEVMODE has strange value. And there is trash
in the following address:
PVOID pvDriverData = (PVOID) (((BYTE *) pdm) + (pdm->dmSize));
where pdm is a starting address of DEVMODE structure.
Can you help me?
Thank you. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79549
Programatically make the Network Interface Card led flash
Most of the RJ45 connector on netword card now have two led.
We bought a Intel Pro/1000 MT dual port adapter. It came with the
ProSet software. One nice feature of this software is a botton to make
one of the two led on the RJ45 connector flashed for 120 second to help
identify the card.
How can i use this feature in a c++ program. Also is it possible to do
the same thing in onboard NIC. Most of the DELL and IBM computer use
BroadCom NetXTreme chip as their NIC. A i would like to control one of
these led.
Thanks. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79547
Error while accessing Video Mini Port Driver
Hello,
I've been searching for a long time to get an information about I2C
interface function calls. I am trying to send DDC commands over I2C bus
to Monitor. I've used WDM Src\WDM\...\ATIShare source code template to
do this.
With the code, given below, I am able to get I2COpen & I2CAccess
function pointers from Video Adapter.(that supports I2C Interface)
But calling I2COpen function always fails and returns 0xC00000C2 error
code. It is
defined in ntstatus.h as
#define STATUS_ADAPTER_HARDWARE_ERROR ((NTSTATUS)0xC00000C2L)
There is no documentation available for this. Does anyone have any
information about the sequence of calls to be issued to access the I2C
Interface? Any help is appreciated.
I'm calling LockI2Cprovider function after LocateAttachI2CProvider
function call. The program fails in LockI2Cprovider () function.
BOOLEAN
LocateAttachI2CProvider(
PDEVICE_OBJECT pVideoDeviceObject,
PI2C_CONTEXT pstI2CContext
)
{
PIRP pIrp;
BOOLEAN bResult = FALSE;
PIO_STACK_LOCATION pNextStack;
NTSTATUS ntStatus;
KEVENT Event;
I2CINTERFACE* pI2CInterface;
if (pVideoDeviceObject == NULL || pstI2CContext == NULL)
{
return FALSE;
}
pI2CInterface = pstI2CContext->m_i2cProviderInterface;
if (pI2CInterface == NULL)
{
return FALSE;
}
pIrp = IoAllocateIrp (pVideoDeviceObject->StackSize, FALSE);
if( pIrp == NULL)
{
return FALSE;
}
pNextStack = IoGetNextIrpStackLocation (pIrp); // original
if (pNextStack == NULL)
{
return FALSE;
}
pIrp->IoStatus.Status = STATUS_NOT_SUPPORTED;
pNextStack->MajorFunction = (UCHAR)IRP_MJ_PNP;
pNextStack->MinorFunction = IRP_MN_QUERY_INTERFACE;
KeInitializeEvent( &Event, NotificationEvent, FALSE);
IoSetCompletionRoutine (
pIrp,
I2CScriptIoSynchCompletionRoutine,
&Event,
TRUE,
TRUE,
TRUE);
pNextStack->Parameters.QueryInterface.InterfaceType =
(struct _GUID *)
&GUID_I2C_INTERFACE;
pNextStack->Parameters.QueryInterface.Size =
sizeof( I2CINTERFACE);
pNextStack->Parameters.QueryInterface.Version = 1;
pNextStack->Parameters.QueryInterface.Interface =
(PINTERFACE) pI2CInterface;
pNextStack->Parameters.QueryInterface.InterfaceSpecificData = NULL;
ntStatus = IoCallDriver (pVideoDeviceObject, pIrp);
if( ntStatus == STATUS_PENDING)
{
KeWaitForSingleObject(
&Event,
Suspended,
KernelMode,
FALSE,
NULL);
}
if ((pI2CInterface->i2cOpen == NULL) ||
(pI2CInterface->i2cAccess == NULL))
{
return FALSE;
}
else
{
DebugPrint ("deviceInfo->m_i2cProviderInterface->i2cOpen 0x%x",
pI2CInterface->i2cOpen);
DebugPrint ("deviceInfo->m_i2cProviderInterface->i2cAccess
0x%x",
pI2CInterface->i2cAccess);
}
pstI2CContext->m_pdoDriver= pVideoDeviceObject;
bResult = TRUE;
if( pIrp != NULL)
IoFreeIrp( pIrp);
return bResult;
}
BOOLEAN LockI2CProvider (PI2C_CONTEXT pstContext)
{
NTSTATUS status;
if ((pstContext->m_i2cProviderInterface->i2cOpen == NULL) ||
(pstContext->m_i2cProviderInterface->i2cAccess == NULL) ||
(pstContext->m_pdoDriver == NULL))
{
return FALSE;
}
pstContext->i2cAccessBlock->Status = I2C_STATUS_NOERROR;
status = pstContext->m_i2cProviderInterface->i2cOpen (
pstContext->m_pdoDriver,
TRUE,
pstContext->i2cAccessBlock);
if (status != STATUS_SUCCESS)
{
DebugPrint ( "CI2CScript: LockI2CProvider() status =
0x%lx\n",
status);
return FALSE;
}
pstContext->m_dwI2CAccessKey =
pstContext->i2cAccessBlock->dwCookie;
DebugPrint ("LockI2CProvider m_dwI2CAccessKey %ld",
pstContext->i2cAccessBlock->dwCookie);
return TRUE;
}
Thanks
VK Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79538
I want to capture keystokes at first
Hi,
I am working on windows driver develpoment for USB keyboard.
Data from UHC comes in form of usb packets i.e URB. Can anyone please
tell me where i will get exact data or characer from URB at first.
Whether i can capture exact data(character) at first in
hidusb.sys/hidclass.sys/kbdhid class mapper driver or in some other
driver?
Please give me necessary inputs regarding this.
Thanks in advance,
nash
--
nash
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79533
Win98 Smartcard Reader Hot plug-in problem
My Win98 USB Reader driver works well if USB reader plugged before Win98
boot. But if I plugged reader after Win98 boot, seems pc/sc manager couldn't
talk to
driver correctly. From driver debug, I found all driver PnP enumerate IRP
worked well, but driver couldn't get smartcard service request. I wonder if
pc/sc manager support USB reader hot plug-in in Win98? Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79527
HCT12.1 DrverPath Test got 0x000000C4(0x00000090...) Bluescreen
Hello Everyone:
I run HCT12.1 DevicePath Test for my smartcard reader driver, it got
bluescreen with 0x000000C4(0x00000090..) message. But if I run DDK tool
dc2.exe in command line for my driver, like: dc2 /hct /dr drivername. It
PASSED. What's the different between these two kinds of tests??
When I got BS, how to use the dump file ? I have tried to open dump file in
windbg, it returned"symbol not found", I have added pdb file into the "symbol
path". Any more setting I need ?
Thank you for everyone's attention! Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79525
"KsPinGetFirstCloneStreamPointer" is failing
Hello,
I am writing AVstream minidriver and new to direct show. I am
using "KsPinGetFirstCloneStreamPointer" function to clone stream buffer
and Its some time its failing and some times its not.
1) What are the reasons for failing this fucntion?
2)A Basic question why it is required to clone?
Please help me out to get answers to these question.
Thanks and Regds,
Darshan Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79522
How to send a simple MIDI-note on a soundcard?
I am a newbie in kernel-streaming topics and the drivers...
All I need is to play a midi-note in windows kernel-mode. Like
MidiOutShortMessage in WinAPI.
Where can I read the manuals or examles? Must I use IMiniport
interfaces or
create complex streams? But how to use this IMiniport interfaces I
don't
understand completely.
All I understand now is to find some PortMidi in system, create a new
stream
in his Mimiport and to write data. But I don't knpw how to find this
Port. I
think, there is no need in creating new port.
Can you give me code-examples or even ready code? It is easier to
understand
topics with examples.
I must implement this in coming days, it is my home task in university.
--
Avtoritet
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79517
How to send USB Set_Idle request to HID driver?
I have a USB mouse device that repeatedly sends reports even when
nothing has changed. I need to issue a USB Set_Idle request to tell it
to only report changes. This mouse uses the built-in HID class driver
that's part of Windows.
Can this be done from a user-mode app? I looked at al the HidD_Xyz
functions, but didn't see anything. If this can only be done from a
driver, how would I go about getting a reference to the standard HID
class driver associated with this device so I can send it a USB URB?
I tried using IoGetDeviceInterfaces( &GUID_DEVINTERFACE_HID ) and
calling IoGetDeviceObjectPointer on every device it found, but it
failed with every device. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79516
Why doesn't mirror driver catch BitBlt sometimes?
my mirror driver can catch BitBlt call. But I noticed that it's failed
to catch BitBlt sometimes immediately after I change the screen
resolution. I want the mirror driver be able to capture the whole
screen at first by using
BitBlt(hdc2,0,0,SCREEN_WIDTH,SCREEN_HEIGHT,hdc1,0,0,SRCCOPY)). I found
that BitBlt was executed successfully, But mirror driver didn't capture
it. why? BTW, if I right click the task bar and select show the
Desktop, the mirror driver may capture the whole screen always.
Does anyone help me out? any comment? Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79515
WMI Property Page for Driver
I have added WMI support for the driver and I can access the class and
the properties using wbemtest and other utlilities.
However, there is something that the DDK mentions about having a
Property Page and I am not able to see where the propety page comes or
how to enable the property page ?
I have browed theough the device manager, services menu et al but I
cant find it.
this is what the DDK says...
"Drivers can automatically expose any WMI classes they implement on
their property sheet by using the WMI generic property page provider."
I have enabled everything through the INF that the DDK says about the
property page provider and the co-installer as below, but I still can't
find the damn property page..neither in the device manger( by right
clicking the device or elsewhere). Any help is appreciated.
Thanks.
This is from the DDK and I am doing everything as below.
Enabling the Generic Property Page Provider
To use the WMI generic property page provider with your driver, you
must enable wmiprop.dll as a device co-installer.
In the CoInstaller add-registry-section, register wmiprop.dll as a
co-installer for the WMI class by adding a value entry for the class
GUID under the HKLM\System\CurrentControlSet\Control\CoDeviceInstallers
key. The value for the value entry is "WmiProp.dll,
WmiPropCoInstaller". For example:
; This section is defined in the CoInstaller section, as follows.
; [CoInstaller]
; AddReg = CoInstaller_AddReg
[CoInstaller_AddReg]
HKLM, System\CurrentControlSet\Control\CoDeviceInstallers, ClassGUID,
0x00010000, "WmiProp.dll, WmiPropCoInstaller"
ClassGUID is the GUID for the WMI class. See Registering a Class
Co-installer for details.
You must also specify the particular WMI classes to be exposed through
the generic property provider. To do this, set the WmiConfigClasses
value-entry to be a comma-separated list of the WMI classes in the
add-registry-section of the device class or device hardware instance.
; the device class AddReg section.
[device_class_AddReg]
HKR,,"WmiConfigClasses",0x00000000,"class1,class2"
; the device hardware instance AddReg section.
[device_hw_inst_AddReg]
HKR,,"WmiConfigClasses",0x00000000,"class3" Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79511
Pen Drive Ids
As I obtain this information of pen drive? (vendorid, productid...)
Use XP SP2 and VB.net 2005
Some idea?
Thanks! Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79510
Help with Hidd_GetAttributes
The Hidd_GetAttributes function does not return the information to me of my
device USB (they pen drive). It returns all 0.
GetLastError returns code 50.
Use XP SP2 and VB.net 2005
Some idea?
Thanks!
PS: CreateFile works OK Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79502
Driver project configuration.
Hi all,
I'm interested in developing Win32 device drivers using the Visual Studio
.NET 2003 IDE. (I'm purposely trying to avoid using DDK make files for
internal maintenance reasons - trust me, they warrant this action.) Since I'm
developing the drivers from scratch I thought I should be able to do this
without problems. I've read a few articles about device driver development
and have successfully implemented an example driver using the IDE by
manually specifying the necessary compiler switches, but I'm not sure how to
make certain features work. For example, if I enable C++ exception
handling, I receive the following link error:
Defs.obj : error LNK2019: unresolved external symbol __CxxThrowException@8
referenced in function "void * __cdecl operator new(unsigned int,enum
EMemPool)" (??2@YAPAXIW4EMemPool@@@Z)
I discovered that if I manually link in the "libcmt.lib" library then the
symbol is resolved, but this is no good because it results in the following
link errors (as I expected):
kernel32.lib(KERNEL32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE specified
when importing from 'KERNEL32.DLL'; Use /SUBSYSTEM:CONSOLE or
/SUBSYSTEM:WINDOWS.
LINK : warning LNK4078: multiple '.rdata' sections found with different
attributes (C0000040)
My project is obviously implemented in C++. Now, I know just about every
driver developer out there is thinking that one should never use C++ in
drivers, but I have yet to discover any compelling reason why, so unless you've
got one, please don't respond to this post only to bark at me about how C++
is evil (or whatever.) Please understand that when you respond to the post
others that have the answers I need won't because they will assume I have
received the information I need.
I've overridden the global new and delete operators so I can control whether
memory is allocated from the paged or non-paged pool and I've carefully
selected my compiler switches to insure that all necessary sections exist
and have the proper attributes. At this time it seems that the only problem
I have is that I'm missing the VC++ exception handling routines that live
the CRT libraries. So I either have to not use exceptions, which is a major
loss to me, or find out how to resolve these symbols. Can anyone point me
in the right direction?
I'm also not sure what I'll be loosing by opting not to use the DDK build
system (make files) and using the VS.NET 2003 IDE instead. Is there
anything or do the make files primarily just configure build switches, etc?
Thanks in advance,
Matt Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79501
Mount manager and virtual disk drive
Hello,
I devloped a virtual disk driver based on the ramdisk sample several years
ago.
Now we found out, that I can't share the drives on the network or defrag it.
Every time I try create a share name I get an error like
"device or directory dosen't exist".
I guess that IoRegisterDeviceInterface () may solve my problem, but I don't
have a PDO...
Can swenum supply me a "virtual PDO" ?
Is there anywhere a sample for swenum?
Regards
Kalle Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79495
KSDATARANGE problem (AVSTREAM)
Hello.
i defined a several struct describing output pin resolution of AVSTREM
minidriver like this
#define D_X 160
#define D_Y 120
const KS_DATARANGE_VIDEO FormatRGB24Bpp_Capture0 =
{
// KSDATARANGE
{
sizeof (KS_DATARANGE_VIDEO), // FormatSize
0, // Flags (Ignored)
D_X * D_Y * 3, // SampleSize (Ignored)
0, // Reserved (Reserved)
STATICGUIDOF( KSDATAFORMAT_TYPE_VIDEO ), // aka. MEDIATYPE_Video
0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b,
0xa7, 0x70, //MEDIASUBTYPE_RGB24,
STATICGUIDOF( KSDATAFORMAT_SPECIFIER_VIDEOINFO ) // aka.
FORMAT_VideoInfo
},
TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
TRUE, // BOOL, bTemporalCompression (all I frames?)
KS_VIDEOSTREAM_CAPTURE,// Reserved (was StreamDescriptionFlags)
0, // Reserved (was MemoryAllocationFlags
(KS_VIDEO_ALLOC_*))
// _KS_VIDEO_STREAM_CONFIG_CAPS
{
STATICGUIDOF( KSDATAFORMAT_SPECIFIER_VIDEOINFO ), // GUID
KS_AnalogVideo_None,
D_X, D_Y, // InputSize, (the inherent size of the incoming signal
// with every digitized pixel unique)
D_X, D_Y, // MinCroppingSize, smallest rcSrc cropping
rect allowed
D_X, D_Y, // MaxCroppingSize, largest rcSrc cropping
rect allowed
1, // CropGranularityX, granularity of cropping
size
1, // CropGranularityY
1, // CropAlignX, alignment of cropping rect
1, // CropAlignY;
D_X, D_Y, // MinOutputSize, smallest bitmap stream can
produce
D_X, D_Y, // MaxOutputSize, largest bitmap stream can
produce
1, // OutputGranularityX, granularity of output
bitmap size
1, // OutputGranularityY;
0, // StretchTapsX
0, // StretchTapsY
0, // ShrinkTapsX
0, // ShrinkTapsY
333333, // MinFrameInterval, 100 nS units
10000000, // MaxFrameInterval, 100 nS units
8 * 3 * 1 * D_X * D_Y, // MinBitsPerSecond;
8 * 3 * 30 * D_X * D_Y // MaxBitsPerSecond;
},
// KS_VIDEOINFOHEADER
{
0,0,0,0, // RECT rcSource;
0,0,0,0, // RECT rcTarget;
D_X * D_Y * 8 * 3 * 30, // DWORD dwBitRate;
0L, // DWORD dwBitErrorRate;
333333, // REFERENCE_TIME
AvgTimePerFrame;
// KS_BITMAPINFOHEADER
sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
D_X, // LONG biWidth;
D_Y, // LONG biHeight;
1, // WORD biPlanes;
24, // WORD biBitCount;
KS_BI_RGB, // DWORD biCompression;
D_X * D_Y * 3, // DWORD biSizeImage;
0, // LONG biXPelsPerMeter;
0, // LONG biYPelsPerMeter;
0, // DWORD biClrUsed;
0 // DWORD biClrImportant;
}
};
#undef D_X
#undef D_Y
And found one problem, when i defined a several resolutions with 160 width
(for i.e. 160x120, 160x128, 160x140) AMCAP incorrectly draws resolution list
in stream format dialog resolution list - some items is on the incorerect
position (i suppose that they should appear in the order as i define it in
KSPIN_DESCRIPTOR_EX) and another bug is when i select 160x120 and then opens
this dialog again the current selection is 160x140 :(
Can anybody advise what the problem is?
Thanks.
-Tulup Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79488
Which class to use?
Hi to all,
i am planning to start developing a usb device which has to send continious
numbers to the application. I don't want to write a driver. Can i use the
drivers already existing. If so which device class can i use for that.
Pls shre ur knowledge with so that i can finish my mini project by capturing
continious data from usb. Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79484
how to get volume instance for a USB device ?
Anyone has any suggestion how the interface ID in the volume class can be
acquired based on a known USB drive ?
A parameter in USB device registry, "ParantIdIndex", contains the right
information, but there is no corresponding SPDRP_xxx for that parameter.
Thanks
-Gary Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79472
Printing drivers architecture
Hi
I've read the information in the DDK about the printing architecture
and I have several questions:
1. Is there a better documentation about the printing architecture then
the MSDN?
2. Why some printers print in raw and some in EMF? How this decision is
being taken after an application is issuing a "Print" command?
Is there a way to always produce an EMF file instead of RAW, regardless
the printer being used?
3. My goal is eventually to get an EMF file from each print request,
analyze it and block / deny the printing. So, Where in the "chain"
is the best place to enter to do such a thing?
Thanks Tag: Get Ready for the WinHEC 2006 Guest Blogger Series Tag: 79463