Smulating DHCP and ARP responses
Hi,
I am (still) writing a virtual network adapter and need to simulate DHCP and
ARP responses. The question is not about the content of response. The
question is how to send the response packet to whoever sent the request?
What methods should be used in ndis5.1 miniport and ndis6 miniports?
Thanks,
Anatoly. Tag: [DTM] Is the device necessary? Tag: 96879
Driver to Extract Text and Positional Info, Create PDF, and Forward to another Printer
I have a project running that requires me to extract the text data and its
position information from a print job as well as create a standard file
(probably a pdf) and then forward the job to another printer ( for printing
on paper ). I have never worked with Printers before and was wondering if
you could recommend a good resource or three for me.
I am hoping to use a Universal Printer Driver from Microsoft and attach to
the appropriate events so that I can snag a copy of the print image (in what
format? i don't know), forward the job immediately to another printer, and
then do my analysis on the image.
This must work on Win2K, XP, 2003, Terminal Server, and Citrix for Terminal
Services.
Thank you for your help.
Rob.
Perfect World Corp.
robl@perfectworld.net Tag: [DTM] Is the device necessary? Tag: 96861
Nasty teen in the toilet
That chick mastrubates wildly, then pisses
[url]http://pissing-skills-avi.info/WindowsMedia?218571[/url]
--
Adanertaplo00
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: [DTM] Is the device necessary? Tag: 96860
STATUS_INVALID_DEVICE_REQUEST with IoGetDeviceObjectPointer
Hello,
- I have two drivers, with one I create a device with IoCreateDevice
and I can see my device created in devicetree and in WinObj applications.
- With the other driver I used IoGetDeviceObjectPointer to handle the
device object pointer from the first driver.
When I call IoGetDeviceObjectPointer I have an error. It returning
STATUS_INVALID_DEVICE_REQUEST all the time.
I check and re-check with devicetree, my device exist. But with WinObj
I can see my device but when I double-click on it I have an error, I can't
access to the properties. Maybe it is a right access problem.
Do you have an idea to resolve this problem ?
Regards, Tag: [DTM] Is the device necessary? Tag: 96859
Driver development team
It seems, to me, driver development is different from application development
at a large scale. I wonder how hard it is to develop a team in a relatively
small development house - let alone an efficient team. It is not possible to
get a lot of driver development job - so few programmers are interested to be
specialized at this area. And as you do not get driver developer easily you
can not manage project easily - and loss interest for future driver projects.
Strange situation.
--
Sincerely,
Maruf Maniruzzaman,
Software Engineer,
Dhaka, Bangladesh.
http://www.kuashaonline.com Tag: [DTM] Is the device necessary? Tag: 96847
Where i can download WDK XP?
I only have seen the link for "WDK Longhorn Server Beta 3" in
connect.microsoft, but i want download a version for windows xp professional
sp1, can i use the same version for longhorn and xp? Tag: [DTM] Is the device necessary? Tag: 96829
IRP_MJ_CREATE
hello
I am making a file system filter driver and I am trying to send an irp
request to the lower driver I am attached to,
the file exists, I just want the file sysyem driver to open it and
give me the file_object structure, VIA irpstack.
I do it like so:
try
{
RequestIrp=IoAllocateIrp(TargetDevice->StackSize,FALSE);
if (!RequestIrp)
return STATUS_INSUFFICIENT_RESOURCES;
RequestIrp->Tail.Overlay.Thread=PsGetCurrentThread();
RequestIrp->RequestorMode=KernelMode;
iosb.Information=0;
iosb.Status=STATUS_SUCCESS;
RequestIrp->UserIosb=&iosb;
RequestIrp->Flags=IRP_SYNCHRONOUS_API|IRP_CREATE_OPERATION;
irpStack=IoGetNextIrpStackLocation(RequestIrp);
irpStack->MajorFunction=IRP_MJ_CREATE;
irpStack->Parameters.Create.EaLength=0;
irpStack->Parameters.Create.FileAttributes=FileAttributes;
irpStack->Parameters.Create.Options = CreateOptions;
irpStack->Parameters.Create.SecurityContext->AccessState = NULL;
irpStack->Parameters.Create.SecurityContext->DesiredAccess
=DesiredAccess;
irpStack->Parameters.Create.ShareAccess = ShareAccess;
}
finally
{
DbgPrint("Could not make create file request");
}
my question is where do I set the file name that I want to open or
create, and I also want to know if the irpStack->FileObject will
point to the new file object created or I will need to fill this field
with a pointer to a file object structure.
The main question is where should I specify the name of the file about
to be created/opened.
thanks Tag: [DTM] Is the device necessary? Tag: 96825
Can't install kbfiltr.sys
Hi,
I'm not sure this happened ever before. At least I didn't found anything:
I can't install kbfiltr.sys with the standard kbfiltr.inf!
Yes! The DDK kbfiltr! I modified the kbfiltr driver a little, but did
nothing to the .inf file,
If I install it over the device manager, for the ps/2 keyboard, it tells
me it can't copy any files which are already there. That seem to be the
files from keyboard.inf which are included in kbfiltr.inf: kbdclass.sys
and i8042.sys. Of course they are already there. And if deleted they get
immediately restored by the Windows File Protection. And I think I
_need_ keyboard.inf. Since it's a keyboard filter driver. And the
include instruction was _always_ in the .inf file.
How comes this strange error? I mean: on another PC it worked! Also with
Windows File Protection on. The installation worked and I got all the
right registry entries. And since it's a pnp-device-filter there are
much more entries than just the things under "\Services". You don't want
to make them all by hand.
Any ideas why this is happening? What's wrong with my Windows XP SP2
(all patches included)?
Thanks
Jan Diederich Tag: [DTM] Is the device necessary? Tag: 96822
help with drivers
Hi there everyone..can someone tell me if i can update or change a driver as
my comp blue screens ..and an error report says it is my driver??????
--
keep those fingers active Tag: [DTM] Is the device necessary? Tag: 96820
Nasty teen in the toilet
That chick mastrubates wildly, then pisses
[url]http://pissing-skills-avi.info/WindowsMedia?218571[/url]
--
Laane
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: [DTM] Is the device necessary? Tag: 96813
NDIS IM, ethernet loopback
i'm developing a NDIS IM that has to wrap ethernet packets into
ethernet packets.
due to its very specific application, the wrapper's destination has to
be set to broadcast. yes, the wrapper also preserves the original SRC
and DST MAC addresses, exactly as i got them from the upper layer.
obviously, ALL of the packets i send, i get at the receive codepath.
consequently, i have to mime the NDIS' loopback handling, and drop (by
not indicating upper) the exact samt packets that NDIS wouldn't loop
back if my driver wouldn't have been installed.
Q: except for two trivial cases* that i figured out myself, are there
any other cases when the packet should be looped back?
problem is - i've already implemented the handling of these two cases,
and some protocols (particularly, ARP) seems to not behave well.
thanks in advance.
- - -
* the trivial cases are these:
1. if the original DST was broadcast,
2. if the original DST is the same as the original SRC. Tag: [DTM] Is the device necessary? Tag: 96812
NDIS IM Layering
According to the WDK documentation, you cannot have more than one NDIS IM
driver of a particular FilterClass (scheduler, loadbalance, failover) in a
stack. This is found under the topic "Filter Intermediate Driver
Installation (NDIS 5.1)".
In practice, I was able to install the WDK sample PassThru and our own
driver which is based on PassThru with no observable problems. Both drivers
have their FilterClass specified as failover in their respective INF files.
Am I misunderstanding something here? Is the documentation making a
recommendation instead of stating policy? Tag: [DTM] Is the device necessary? Tag: 96811
Enabling 1-N Mux (NDIS 5.1) in Network Connections (XP+SP2) window
The Mux that we're working on shows up in the Network Connections window w/ a
Disabled status. When the user attempts to Enable it using the context popup
or any other method, a "Connection Failed" error is reported. The Mux is
not, in fact, disabled. It is passing packets back and forth between the
protocol layer and the NICs. What does an NDIS IM have to do to implement
the Enable/Disable commands?
TIA for any help that you can provide.
Wes Tag: [DTM] Is the device necessary? Tag: 96801
sdiomars based kmdf driver
Hi all
I am working with a prototype sdio multi function card and am working
with a driver based off of the sdiomars kmdf sample.
I am able to load the driver ... the DeviceAdd function is called for
this device (function 1 - function interface code is 0) on the sdio
card. DeviceAdd returns status_success ... however the PrepareHardware
function in never called and the driver is unloaded.
Questions :
1. What could prevent PrepareHardware from being called ? Is it
because the function interface code is 0 ?
2. Is there any debug support in the sdbus host/link libaries to help
figure this out. ?
Since the device is stil under development it could very well be that
something in the CIA is not set up correctly.
Any help/pointers would be appreciated.
Thanks
- rks Tag: [DTM] Is the device necessary? Tag: 96800
How does user mode STI minidriver enable KS device event?
I would write a user mode STI minidriver to monitor PC camera button pressed
event.
How does user mode STI minidriver enable KS device event?
I know IOCTL_KS_ENABLE_EVENT can do that, but how??
Should I use DeviceIoControl or KsSynchronousDeviceControl to send
IOCTL_KS_ENABLE_EVENT?
How do I get the associated KS object or handle of my device in user mode
STI minidriver?
Best Regards
Jack Huang Tag: [DTM] Is the device necessary? Tag: 96796
Is there a call similar to NdisAllocateFragmentNetBufferList() for fragmenting NET_BUFFER structure?
Is there a call similar to NdisAllocateFragmentNetBufferList() for
fragmenting NET_BUFFER structure?
The purpose is to create new netbuffers that carry portions of data in the
original NET_BUFFER, when
the NET_BUFFER data length is more than the maximumphysicalmapping I
informed OS while registering SG DMA channel.
Thanks,
-Praveen Tag: [DTM] Is the device necessary? Tag: 96793
About BDA node types...
Hi,
I wanna combine tuner, demod and capture nodes in a filter.
The node types in the KSNODE_DESCRIPTOR declaration should be
KSNODE_BDA_RF_TUNER, KSNODE_BDA_COFDM_DEMODULATOR(for DVB-T), and
what's the capture node type should be?
Thanks! Tag: [DTM] Is the device necessary? Tag: 96792
Sending simple message to usb device.
Hi,
I am trying to do something that sounds simple but doesn't have an obvious
answer with my current knowlege.
I am trying to send simple messages to a usb board. What I want to do is
send say the #6, just that character, to a usb board that I am working on.
The device has a specific identifier (a model number) so it shouldn't be
hard to find - if I knew where to start.
Thanks in advance,
Kristian
So, if I wanted to write a program to send simple characters to this board -
where do I start? Tag: [DTM] Is the device necessary? Tag: 96781
XP and Vista driver development
I am need of a driver developer for hire. Should be a short contract... 1
Project.
Please give me rates and any interest you my have.
Thanks,
Anthony Tag: [DTM] Is the device necessary? Tag: 96769
FOX NEWS SUED FOR FAKE NEWS
The ham sandwich parody that was reported on FOX and Friends April 24th as
real news (multiple times, as noted by Think Progress) has lead to a lawsuit
by a school administrator affected by the subsequent harrassment.
Boston.com reports:
"Lewiston School Superintendent Leon Levesque is seeking $75,000 in
federal court in Portland to deter what his attorney Bernard J. Kubetz
characterized as irresponsible reporting by Fox News Channel.
...The lawsuit contends that Fox reported the parody as fact on its "Fox
and Friends" show on April 23. The show's anchors repeated a comment
attributed to Levesque, that "These children have got to learn that ham is
not a toy," and that there was an effort afoot to create an "anti-ham
response plan."
..."It appears to me that Fox News acted in a grossly irresponsible way
and took some information that was really not very plausible, did not do any
substantial fact-checking, and put it out as hard news," Kubetz said.
Levesque said he was overwhelmed for days with phone calls and hate mail,
including threatening calls to his home.
Fox did a brief on-air retraction, but Levesque called it unsatisfactory.
A Fox News spokesman in New York said the company does not comment on
pending lawsuits."
One can only hope that the Boulder Valley School District takes note and
follows suit, for Bill O'Reilly's (a.k.a. Donald Duck) reprehensible and
deliberate misrepresentation of a school assembly at Boulder High School.
Bill O'Reilly (and Caplis and Silverman, who also smeared the school on
their radio show) have been asked to respond to the Independence Institute's
issue paper documenting the falsehoods; as far as I can tell neither has
yet. If and when they do News Hounds will cheerfully let you know.
http://www.boston.com/news/local/maine/articles/2007/07/02/school_official_sues_fox_over_report_parody_story_in_maine/
That's why FAUX runs these stories, to use their anonymous army of
"Blackflon"'s to harass and intimidate from the shadows. But at NO COST to
FAUX just the victims of their "stories"
And of course, the nice culture of FOX lifers sent the usual death threats
as a result of the Fox bogus news reports.
On FOX. nothing of Rush,s dope bust, rest assured we will hear plenty about
al gore's son.. Tag: [DTM] Is the device necessary? Tag: 96765
Is there concept of large pages on Vista?
Hi,
Is there a concept of large pages on Vista?
What is the maximum size of contiguous physical memory that is possible to
allocate from an app on Vista and above?
I would like to write an app that allocate a huge contiguous physical
memory and fill it with data and pass it down to
network driver for xmitting (for test purposes)?
Is there a call available that I can use from within my app. The app is
written in C.
Regards,
-Praveen Tag: [DTM] Is the device necessary? Tag: 96764
CreateNamedPipe without Disconnect & CloseHandle
i have a serious problem with CreateNamedPipe:
I am developing a virtual printer driver in VISTA, for that at one
point i use NamedPipe ok..
Now if my all code is run good then there is no any problem becuse at
the end of printing job i disconnect this named pipe and close this
handle.
Now consider the case that my NamedPipe is created and without close
it my printer driver crash at some point means when ever second time
any print job is there it does not createNamePipe gives me error
ERROR_ALREADY_EXISTS that "Cannot create a file when that file
already
exists".
here i write my code for create named pipe
hBitmapPrinterPipe = CreateNamedPipe( L"\\\\.\\Pipe\
\BitmapPrinterPipe", // pipe name
PIPE_ACCESS_DUPLEX|
FILE_FLAG_OVERLAPPED,
PIPE_TYPE_BYTE
|
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
MAX_PATH,
MAX_PATH,
NMPWAIT_USE_DEFAULT_WAIT,
NULL);
if(hBitmapPrinterPipe == INVALID_HANDLE_VALUE) {
GetLastError());
}
Using this code i create my pipe..
so my question is there is any method from which i can reopen my
existing server pipe and close it..
OR there is any solution from which i can open the another instance
of
the same name pipe..
so please write me which solution is best for me and how can i do
it..
Thanks in advance.. Tag: [DTM] Is the device necessary? Tag: 96751
Install two upper filter at the same time?
I'm developing a upper filter for a ps2 mouse like device.
well, there is another a ps2 mouse too and that device has already
installed with a upper filter dirver for the mouclass driver and also
i8042 driver. My question is that is it possible to install a upper
filter ? Thanks
-chueh8 Tag: [DTM] Is the device necessary? Tag: 96750
NDIS60 Miniport sharing memory with user mode and WHQL
Hi,
I need to share memory between user mode application and the NDIS60
Miniport driver:
1. Allocate memory in user space. In driver, I use NdisAllocateMdl
(which will also build MDL and lock the pages depending on the buffer
is from Non Paged pool or not). Then I call
MmGetSystemAddressForMdlSafe to get the driver accessible address. So
will this non NDIS routine (MmGetSystemAddressForMdlSafe) be approved
by WHQL if used in NDIS driver? The DDK points to use this routine
instead of NdisBufferVirtualAddressSafe which is not supported in
NDIS60.
2. Allocate memory in kernel space. I see that the
MmGetSystemAddressForMdlSafe is a macro internally calling
MmMapLockedPagesSpecifyCache function with KernelMode as AccessMode.
Will WHQL approve (assuming MmGetSystemAddressForMdlSafe is approved)
if I use the later routine to map memory to user space?
Please let me know.
Thanks,
Aniketa Tag: [DTM] Is the device necessary? Tag: 96747
usb camera filter driver
This is a multi-part message in MIME format.
------=_NextPart_000_0043_01C7BEEE.4FAA4040
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Everybody,
I write usb camera filter driver, i see toaster filter example in DDK =
and make the same. but i have a problem when use mode application access =
filter driver by IOCL.
Following is kernel mode code is create object control
NTSTATUS
FilterCreateControlObject(
IN PDEVICE_OBJECT DeviceObject
)
{
UNICODE_STRING ntDeviceName;
UNICODE_STRING symbolicLinkName;
PCONTROL_DEVICE_EXTENSION deviceExtension;
NTSTATUS status =3D STATUS_UNSUCCESSFUL;
UNICODE_STRING sddlString;
//PAGED_CODE();
//
// Using unsafe function so that the IRQL remains at PASSIVE_LEVEL.
// IoCreateDeviceSecure & IoCreateSymbolocLink must be called at
// PASSIVE_LEVEL.
//
ExAcquireFastMutexUnsafe(&ControlMutex);
//
// If this is a first instance of the device, then create a =
controlobject.
// and register dispatch points to handle ioctls.
//
if(1 =3D=3D ++InstanceCount)
{
DbgPrint("Start Create Object\n");
//
// Initialize the unicode strings
//
RtlInitUnicodeString(&ntDeviceName, NTDEVICE_NAME_STRING);
RtlInitUnicodeString(&symbolicLinkName, SYMBOLIC_NAME_STRING);
//
// Initialize a security descriptor string. Refer to SDDL docs in =
theSDK
// for more info.
//
RtlInitUnicodeString(&sddlString, L"D:P(A;;GA;;;SY)(A;;GA;;;BA)");
//
// Create a named deviceobject so that applications or drivers
// can directly talk to us without going through the entire stack.
// This call could fail if there are not enough resources or
// another deviceobject of same name exits (name collision).
// Let us use the new IoCreateDeviceSecure and specify a security
// descriptor (SD) that allows only System and Admin groups to access =
the
// control device. Let us also specify a unique guid to allow =
administrators
// to change the SD if he desires to do so without changing the =
driver.
// The SD will be stored in
// HKLM\SYSTEM\CCSet\Control\Class\<GUID>\Properties\Security
// An admin can overide the SD specified in the below call by =
modifying
// the registry.
//=20
status =3D IoCreateDeviceSecure(DeviceObject->DriverObject,
sizeof(CONTROL_DEVICE_EXTENSION),
&ntDeviceName,
FILE_DEVICE_UNKNOWN,
FILE_DEVICE_SECURE_OPEN,
FALSE,
&sddlString,=20
(LPCGUID)&GUID_SD_FILTER_CONTROL_OBJECT,
&ControlDeviceObject
);
if(NT_SUCCESS(status)) {
=20
ControlDeviceObject->Flags |=3D DO_BUFFERED_IO;
status =3D IoCreateSymbolicLink(&symbolicLinkName, &ntDeviceName);
if(!NT_SUCCESS(status)) {
IoDeleteDevice(ControlDeviceObject);
DebugPrint(("IoCreateSymbolicLink failed %x\n", status));
goto End;
}
deviceExtension =3D ControlDeviceObject->DeviceExtension;
deviceExtension->Type =3D DEVICE_TYPE_CDO;
deviceExtension->ControlData =3D NULL;
deviceExtension->Deleted =3D FALSE;
ControlDeviceObject->Flags &=3D ~DO_DEVICE_INITIALIZING;
}else {
DebugPrint(("IoCreateDevice failed %x\n", status));
}
=20
DbgPrint("End Create Object\n");
}
End:
=20
ExReleaseFastMutexUnsafe(&ControlMutex);
return status;
}
Following is user mode application to access filter driver by IOCL:
HANDLE hdevice =3D CreateFile(TEXT("\\\\.\\UsbcameraFilter"), =
GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
if (hdevice =3D=3D INVALID_HANDLE_VALUE)
{
printf("Unable to open UsbcameraFilter device - error %d\n", =
GetLastError());
return 1;
}
When i run debug user mode application it display error in WinDbg is:
Access violation - code c0000005 (!!! second chance !!!)
nt!IofCallDriver+0x24:
804ec046 8b7108 mov esi,[ecx+0x8]
I don't know why, Everyone have experience about write usb camera filter =
driver pls help me, thanks very alot.
David,
------=_NextPart_000_0043_01C7BEEE.4FAA4040
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi Everybody,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I write usb camera filter driver, i see =
toaster=20
filter example in DDK and make the same. but i have a problem when use =
mode=20
application access filter driver by IOCL.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Following is kernel mode code is =
create object=20
control</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>NTSTATUS<BR>FilterCreateControlObject(<BR> &nbs=
p; =20
IN PDEVICE_OBJECT =
DeviceObject<BR> =20
)<BR>{<BR> UNICODE_STRING ntDeviceName;<BR>&n=
bsp;UNICODE_STRING symbolicLinkName;<BR> PCON=
TROL_DEVICE_EXTENSION deviceExtension;<BR> NTSTATUS =
status=20
=3D=20
STATUS_UNSUCCESSFUL;<BR> UNICODE_STRING sddlS=
tring;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //PAGED_CODE();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //<BR> // Using unsafe =
function so that=20
the IRQL remains at PASSIVE_LEVEL.<BR> // IoCreateDeviceSecure =
&=20
IoCreateSymbolocLink must be called at<BR> //=20
PASSIVE_LEVEL.<BR> //<BR> ExAcquireFastMutexUnsafe(&Control=
Mutex);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //<BR> // If this is a first =
instance of=20
the device, then create a controlobject.<BR> // and register =
dispatch=20
points to handle ioctls.<BR> //<BR> if(1 =3D=3D=20
++InstanceCount)<BR> {<BR> DbgPrint("Start Create=20
Object\n");<BR> //<BR> // Initialize the unicode=20
strings<BR> //<BR> RtlInitUnicodeString(&ntDevi=
ceName,=20
NTDEVICE_NAME_STRING);<BR> RtlInitUnicodeString(&symbolicL=
inkName,=20
SYMBOLIC_NAME_STRING);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //<BR> // =
Initialize a=20
security descriptor string. Refer to SDDL docs in =
theSDK<BR> // for=20
more=20
info.<BR> //<BR> RtlInitUnicodeString(&sddlStri=
ng,=20
L"D:P(A;;GA;;;SY)(A;;GA;;;BA)");</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //<BR> // Create =
a named=20
deviceobject so that applications or drivers<BR> // can =
directly talk=20
to us without going through the entire stack.<BR> // This =
call could=20
fail if there are not enough resources or<BR> // another =
deviceobject=20
of same name exits (name collision).<BR> // Let us use the =
new=20
IoCreateDeviceSecure and specify a security<BR> // descriptor =
(SD)=20
that allows only System and Admin groups to access the<BR> // =
control=20
device. Let us also specify a unique guid to allow=20
administrators<BR> // to change the SD if he desires to do so =
without=20
changing the driver.<BR> // The SD will be stored=20
in<BR> //=20
HKLM\SYSTEM\CCSet\Control\Class\<GUID>\Properties\Security<BR> =
; //=20
An admin can overide the SD specified in the below call by=20
modifying<BR> // the registry.<BR> // =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> status =3D=20
IoCreateDeviceSecure(DeviceObject->DriverObject,<BR> =
sizeof(CONTROL_DEVICE_EXTENSION),<BR>=
&ntDeviceName,<=
BR> FILE_DEVICE_UNKN=
OWN,<BR> FILE_DEVICE=
_SECURE_OPEN,<BR> FA=
LSE,<BR> &sddlSt=
ring,=20
<BR> (LPCGUID)&G=
UID_SD_FILTER_CONTROL_OBJECT,<BR> &nbs=
p; &ControlDeviceObject<BR> &=
nbsp; );</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2> if(NT_SUCCESS(status))=20
{<BR> <BR> ControlDeviceObj=
ect->Flags=20
|=3D DO_BUFFERED_IO;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> status =3D=20
IoCreateSymbolicLink(&symbolicLinkName, =
&ntDeviceName);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2> if(!NT_SUCCESS(status))=20
{<BR> IoDeleteDevice(ControlDeviceObject);<B=
R> DebugPrint(("IoCreateSymbolicLink=20
failed %x\n", status));<BR> goto=20
End;<BR> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> deviceExtension =
=3D=20
ControlDeviceObject->DeviceExtension;<BR> devic=
eExtension->Type=20
=3D =
DEVICE_TYPE_CDO;<BR> deviceExtension->ControlDa=
ta =3D=20
NULL;<BR> deviceExtension->Deleted =3D=20
FALSE;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> ControlDeviceObject->Flags &=3D=20
~DO_DEVICE_INITIALIZING;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> }else=20
{<BR> DebugPrint(("IoCreateDevice failed %x\n",=20
status));<BR> }<BR> </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> DbgPrint("End Create=20
Object\n");<BR> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>End:<BR> <BR> ExReleaseFastMutexUnsafe(&ControlMut=
ex);<BR> return=20
status;<BR>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Following is user mode application to =
access filter=20
driver by IOCL:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>HANDLE hdevice =3D =
CreateFile(TEXT("</FONT><A><FONT=20
face=3DArial size=3D2>\\\\.\\UsbcameraFilter</FONT></A><FONT =
face=3DArial size=3D2>"),=20
GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);<BR> if (hdevice =
=3D=3D=20
INVALID_HANDLE_VALUE)<BR> {<BR> printf("Unable to open=20
UsbcameraFilter device - error %d\n", =
GetLastError());<BR> return=20
1;<BR> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>When i run debug user mode application =
it display=20
error in WinDbg is:</FONT></DIV>
<DIV>
<P><FONT face=3DArial size=3D2>Access violation - code c0000005 (!!! =
second chance=20
!!!)</FONT></P>
<P><FONT face=3DArial size=3D2>nt!IofCallDriver+0x24:</FONT></P>
<P><FONT face=3DArial size=3D2>804ec046 8b7108 mov =
esi,[ecx+0x8]</FONT></P>
<P><FONT face=3DArial size=3D2>I don't know why, Everyone =
have experience about=20
write usb camera filter driver pls help me, thanks very alot.</FONT></P>
<P><FONT face=3DArial size=3D2>David,</FONT></P></DIV></BODY></HTML>
------=_NextPart_000_0043_01C7BEEE.4FAA4040-- Tag: [DTM] Is the device necessary? Tag: 96743
Understanding the virtual to physical address translation rule in x86
I hope this newsgroup is suitable for this question. Thanks.
I am reading the article below:
http://www.codeproject.com/system/soviet_kernel_hack.asp
However, I found that I can not understand the conclusion below:
"Under Windows NT, page directory of currently running process is mapped to
the virtual address 0xC0300000. This information, combined with our
knowledge of virtual-to-physical address translation, leads us to two
conclusions:
1.. Under Windows NT, 0x300th entry of a page directory holds the physical
address of the page directory itself.
2.. Page table, corresponding to some virtual address, is accessible as
0xC0000000+((address>>10)&0x3FF000). With such translation page table,
corresponding to the address 0xC0300000, is 0xC0300000 itself. In other
words, page directory is also a page table that corresponds to the virtual
address of a page directory itself. "
How are these 2 conclusion generated?
In the undocumented Win2000 book, I see the linear address can be used to
find its PTE by: (linear_address)>>12 * 4 +0xC0000000. It seems that this
rule is different from the one in the article. Which one is correct?
I find myself a bit confusion regarding the principle.
Thanks in advanced! Tag: [DTM] Is the device necessary? Tag: 96742
Ndis 'filter' driver compile problem in VISTA
Hi
Thanks in advance for any input!
I compiled the WDK sample "ndis FILTER driver" in VISTA. compiled and
linked fine.
But I couldn't add addtional headers like windows.h, winreg.h etc. to
the code.
They are clashing with "ndis.h" and throws zillon errors!
The compiler output log shows the include path is fine -> \\WinDDK
\6000\inc\api\*.*
Any compiler flag or env setting wrong? Any suggestions please?
Thanks much again
Ganesan Tag: [DTM] Is the device necessary? Tag: 96737
Help - Locking Kernel Thread
Can someone give me a few groups on going about locking a kernel thread to
one processor? I have an Intel core 2 duo processor and need to lock a
kernel thread to one of the cores. Any help / suggestions would be greatly
appreciated. Tag: [DTM] Is the device necessary? Tag: 96734
Mouse Driver Stack Structure
Hey dri-xperts:
I am really newbie in the driver world. Who is willing to tell me the
structure of mouse driver in Windows, especially with mouse filter
driver? Tag: [DTM] Is the device necessary? Tag: 96726
Waiting in KMDF
A few more questions
1. If I want to put a thread to sleep in KMDF, what mechanisms can I use?
E.g., lets say EvtIoRead callback is called, yet the hardware resources to
process that are not available yet. I want EvtIoRead to go to sleep until
its woken up by the ISR. In Linux kernel there are wait queues that a
function can sleep on until woken up. Are there similar native constructs
in KMDF, or if not, can I use WDM (if they are available) or WIN32 calls?
Anything besides WaitLock? (WaitLock doesn't seem do just that, as it forces
the code that acquires it to execute as a critical section, AFAIK)
2. Let say the immediate availability of hardware for a DMA depends on how
many scatter-gather elements are in the request and the current state of
hardware due to outstanding requests. I.e., if I follow the framework, I
won't know how many scatter-gather elements are in the request until I am
inside EvtProgramDma callback. If at that point the resources are not
available, I would need to wait for their availability. So:
a) EvtProgramDma runs at DISPATCH IRQL, which means that even WaitLock
cannot be executed in blocking mode. If the hardware resources are not
immediately available, what should the driver do at this point? Spinning for
them seems like a huge waste of processor cycles.
b) Alternatively, I could postpone DmaExecute until all the resources are
available and spin on that in the Io callback at passive IRQL (see quesetion
1). However, is there a way to infer how many items will be in the
scatter-gather list at that point? Is (request_size/PAGE_SIZE+1) a definite
upper bound? Tag: [DTM] Is the device necessary? Tag: 96724
RNDIS Composite Device
Hi,
we have build a composite device with a RNDIS interface and a CDC ACM
interface.
If RNDIS uses the usb interfaces 0 and 1 evrything works fine. If I use the
USB interfaces 2/3 for RNDIS I get a blue screen in usb8023.sys. The blue
screen appears after the configuration descriptor was requested from the MI
driver.
OS: Windows XP SP2 without hot fixes.
Has anybody a running solution where RNDIS works on a USB interface grater
than 0/1 ?
Thanks Guenter Tag: [DTM] Is the device necessary? Tag: 96715
Is there any need for extra code to run WHQL tests?
Hi,
I am writing a miniport driver for a PCI based network adapter. My question
is - do I have to write any extra code or routines in the driver so that the
DTM
test controller can run the network card related tests ?
I see that there are some macros and constants to aid debugging. Is there any
similar set of routines available to display or collect output from the run
of WHQL testcases?
Regards,
Sreenivasulu Y Tag: [DTM] Is the device necessary? Tag: 96713
Restricting access to USB devices based on session
Hi,
I have a server running on Windows Server 2003. I have a filter driver which
filters IRP_MJ_CREATE requests. My intension is to block certain users from
accessing the USB device(say, a thumb drive) based on session id. I have used
SeQueryAuthenticationIdToken to get the session id in my dispatch function
for IRP_MJ_CREATE in my filter driver.
When I tried to access the device from the explorer (from different
sessions), I expected a IRP_MJ_CREATE request so that I can block certain
users. However, I observed that the session Id that I get is ALWAYS "0" in my
filter driver. Is this correct?
One more thing is that I didnt see a IRP_MJ_CREATE when I opened a explorer
from a session to access the device. Is this how it works?
How can I acheive what I want?
Any comments are most welcome
Thanks,
Sri Tag: [DTM] Is the device necessary? Tag: 96711
Changes to PTE Structures on Vista
Hi,
recently I had to debug something strange on Vista and as I closer examined
the problem I ran this command on Vista and on XP:
dt -b nt!_MMPTE
What it does is showing you the definition of the kernel PTE structures. I
did compare the results of both systems and to my surprise there were some
changes regarding the name of the first bit within the _MMPTE_HARDWARE
structure. Pre Vista this bit was called Write (Uniprocessor) or Writable
(Multiprocessor) depending on the kernel being used. Somehow this bit has
gotten a new name "Dirty1". Is this only a name change that has occured or
does the name change reflect a change in functionality?
The WinDbg help file describe this bit imho somewhat confusing:
"Writeable or read-only. Only on multiprocessor computers and any computer
running Windows Vista or later"
I don't think the approriate description could fit into one sentence (mabye
a very long sentence). On Pre-Vista OS this bit 1 depends on the kernel
being used so it is either called Write or Writable (on MP systems bit 11 is
called Write and actually 2 bits are being used to prevent stalls across
processors during write access). On Vista it is either something completely
new and undocumented (now using a single write bit and two dirty bits Dirty
and Dirty1) or the functionality of Vista is basically equivalent to the
behaviour of Pre-Vista MP kernels (XP,2000,...). If the latter case there
should be two tables, one for MP and one for UNI. If the first is the case
here, even more tables would be required (and comments).
Does anyone know what happened here??
Cheers / Andreas Denter Tag: [DTM] Is the device necessary? Tag: 96697
WinDbg !ALPC Command on Vista
Hi,
I am trying to run the !ALPC command within WinDbg on Vista and was told in
another newsgroup (WinDbg) that it requires non public symbol files in order
to succeed.
What I am trying to do is debug an old application hanging and from what I
see it is waiting for an LPC call. Afaik LPC is now emulated through ALPC.
WinDbg does not support the "old" and well functioning !lpc command and
tells you to use !alpc instead which is broken because the required symbols
are not available to the public. How can someone debug such a problem? Could
the problem be solved with another debugger (application) or should it be
solved within Windows and its symbols (operating system)? Unfortunately
there is not too many alternatives to WinDbg remaining on the market.....
Cheers / Andreas Tag: [DTM] Is the device necessary? Tag: 96696
File system monitor
hi
I am trying to develop a very simple file system monitor. I looked in
the WDK at the sfilter sample and this is the aproach I want to go
with (attach to the device and receive I/O notifications)
The thing is that the sample is too big for me I have to admit, and
too complex, I don't need to monitor pipe I/O or CD-ROM or other I/O
just the files on the local volumes.
I tried to make a separate device that attaches to \\Device\
\HarddiskVolume1 but I don't seem to get any I/O notifications.
In my driver entry routine I first get the device object pointer of
the target device mentioned above useing GetDeviceObjectPointer, with
FILE_READ_ACCESS
Then I create my own device with the same device type and
characteristics as the target device.
after this I set my device's flags to DO_BUFFERED_IO and direct_io
Then I attach my device to the target device.
After this I expect that in my read,write, mj_file_system_control
dispatch routines to receive irps, because I am attached, but i don't
receive them
Probably I am missing something, I mean for sure I am missing
something. I want if you can to point me somewhere where a similar
code posted and explained. I have worked with drivers before but not
with File_system drivers, and I know they are the hardest to manage.
Or if someone is kind enough to give me right steps in order to get I/
O requests from an attached device driver. Tag: [DTM] Is the device necessary? Tag: 96693
problem with IOCTL_TAPE_GET_POSITION
I have a class for controlling a Sony digital tape player, and have
successfully used various IOCTL tape commands, but I am having a problem
with TAPE_GET_POSITION:
CODE:
{
DWORD junk;
DWORD err = 0;
TAPE_GET_POSITION tgp;
tpg.Type = TAPE_ABSOLUTE_POSITION;
if (!DeviceIOControl(tapeHandle, IOCTL_TAPE_GET_POSITION, &tgp, sizeof(tgp),
NULL, 0, &junk, (LPOVERLAPPED) NULL)) err = GetTapeError();
return err;
}
I am getting error 24, ERROR_BAD_LENGTH
"The program issued a command but the length is incorrect"
TAPE_GET_POSITION is defined in WinNT.h as:
typedef struct _TAPE_GET_POSITION {
DWORD Type;
DWORD Partition;
LARGE_INTEGER Offset;
} TAPE_GET_POSITION, *PTAPE_GET_POSITION
Any help would be appreciated. Tag: [DTM] Is the device necessary? Tag: 96690
KMDF Scatter-Gather in EvtProgramDma vs Common Buffer
Hi everyone
I am implementing a KMDF driver for a PCIE device and following the
toolkit's DMA framework. I don't see an elegant way of solving my problem.
My hardware device has up to 16 DMA engines, so it is capable of initiating
multiple DMA transfers in parallel. I can use that functionality to
implement scatter-gather transfers or multiple transfers, but there are
limitations which I don't seem to be able to overcome.
1. A length of the DMA access for this device has to be a multiple of 128.
I truncate the user IO request to satisfy that requirement for the
transaction as a whole. However, certain elements of SG list I receive in
EvtProgramDma, do not necessarily satisfy this requirement. Is there a way
to force the framework to force minimal length of SG list fragments? Setting
device alignment to 127 doesn't help. Not sure if forcing user apps to do
128-byte alignment would solve this problem...
2. Alternatively, I could switch to using packet-based rather than SG-based
DMAs, but framework claims to have a limit of no more than a single
outstanding DMA at any given time when used in packet mode. That would not
allow me to achieve good PCIE utilization at all, i.e. much lower bandwidth -
doesn't work.
Any way of overcoming the limitation? Why is it there in the first place?
3. Finally, I could do DMA transfers to a pre-allocated common buffer, and
then copy them into the user buffer. WDF documentation doesn't really show
how that plugs into the framework. I understand I could take an interrupt,
schedule a work item at a lower IRQL, and in the work handler get a handle to
user request memory and copy it there from the common buffer. However, would
calling DMA completion routines interfere with that, e.g. overwrite the
request memory or do something equally bad? Furthermore, I would effectively
be doing DMA my way. Is there a WDF-suggested way of using common buffer
with DMAs where the DMA results need to be copied to the user buffer?
Any suggestions would be much appreciated. Tag: [DTM] Is the device necessary? Tag: 96688
Device-defined index of the descriptor for a USB scanner
Hello,
I am writing a user-mode driver for a USB scanner, adapted from the wiascanr
sample.
I want to use the IO Control code IOCTL_GET_USB_DESCRIPTOR.
In DeviceIoControl parameters, I need lpInBuffer, which is a pointer to the
USBSCAN_GET_DESCRIPTOR structure:
typedef struct _USBSCAN_GET_DESCRIPTOR {
IN UCHAR DescriptorType;
IN UCHAR Index;
IN USHORT LanguageId;
} USBSCAN_GET_DESCRIPTOR, *PUSBSCAN_GET_DESCRIPTOR;
In this structure, Index "specifies the device-defined index of the
descriptor that is to be retrieved."
Where can I find this value?
Thank you! Tag: [DTM] Is the device necessary? Tag: 96683
Need information about writing kernel-mode debuggers
Hi,
I need information about writing kernel-mode debugger such as SoftIce. Any
link, book or sample is appreciated.
Thanks in advance. Tag: [DTM] Is the device necessary? Tag: 96678
Ethernet and BDA
Hello!
I have written drivers for 1394 DVB tuner devices. The drivers support the
BDA interface.
Now I have got an Ethernet device connected to my Ethernet bus / Ethernet
card. The objective is to implement the same solution for this device
(supporting a BDA tuner and BDA receiver filter).
Has anybody got some experiences or hints relating an Ethernet / BDA
implementation?
Would NDIS be the right way to go?
Thanks in advance,
Best regards,
Norbert Tag: [DTM] Is the device necessary? Tag: 96673
64-bit DMA transaction for PCIe interface
Dear All,
I am porting AVStream driver to a TV capture addon card with PCIe
interface. This PCIe card supports 64-bit DMA transaction with ScatterGather
feature and it is a DMA bus master. I used IoGetDmaAdapter function to get
DMA_ADAPTER structure. However, the WDK document about "DEVICE_DESCRIPTION"
said that
***********************************************************
If the ScatterGather member is set to TRUE and the InterfaceType member is
set to PCIBus, the Dma32BitAddresses member is ignored and the device is
assumed to support 32-bit DMA addresses.
***********************************************************
Does it mean that I cannot use the 64-bit DMA transaction of this PCIe card?
How can I enable 64-bit DMA transaction?
Thanks,
Edward Tag: [DTM] Is the device necessary? Tag: 96663
Setting OID_802_11_ADD_KEY through WMI
I used wbemtest to query the classes of the MSNDIS superclass. It looks like
none of the classes support WPA or WPA2. For example, there is no class that
can be used for OID_802_11_ADD_KEY or OID_802_11_ENCRYPTION_STATUS. Can
WPA/WPA2 attributes be set on an underlying 802.11 miniport driver through
WMI? Tag: [DTM] Is the device necessary? Tag: 96662
I'm right about Drivers?
If I have learned well there are 2 types of drivers generations:
1) WDM (Windows Driver Model)
2) WDF (Windows Driver Foundation)
WDM is the "old" way of driver development (3790.1830 for example) and
WDF the new way (6001 for example) . In WDF I have a framework that
semplify sistem integration so the user can concentrate on driver
functionality and not on driver integration with OS. In WDF i can have
2 types of drivers UMDF (User Mode Driver Framework) and KMDF (Kernel
Mode Driver Framwork). Each one use methods, propertis and events of
the framework to manage driver stack and IRP flow and not directly
over objects.
Is right all I have write?
Best regards GM Tag: [DTM] Is the device necessary? Tag: 96656
Install VHidMini.sys as 1st HID Driver Problems
I'm writing a HID driver based on the VHidMini.sys source in the 11/2006 WDK.
I'll use vhidmini in the examples below. If I install vhidmini and there is
alerady a HID driver on the system, such as a USB mouse, the driver installs
an I can use the test program to talk to it.
I'm installing vhidmini on Vista Business 32 and Vista Ultimate 64.
If I install vhidmini as the first ever HID driver, the install fails with a
'The system cannot find the file specified" error. I'm install using Device
Manager by right clicking one of my unknown devices (using HPQ0004 in this
example until our real acpi id is available in the BIOS) and selecting Update
Driver Software..., then choosing Browse my computer for driver software,
then choosing Let me pick from a list of device drivers on my computer, the
choosing Next, then choosing Have Disk, then pointing to the directory where
the driver inf and sys files are located and then choosing Next.
Seems like there is a problem finding hidclass.sys. How do I change the
vhidmini.inf so that the basic HID files (hidclass, hidparse...) get
installed correctly?
Start of inf file
**********
[Version]
Signature="$CHICAGO$"
Class=HIDClass
ClassGuid={745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Provider=%VENDOR%
CatalogFile=vhidmini.cat
LayoutFile=layout.inf
DriverVer=09/21/2006,6.0.5736.1
;
; Layout.inf (etc.) list all files shipped with the operating system so the
; source description sections are only needed if other files are needed.
;
; In order to use IHV drivers, the SourceDisksNames section must list the
; disk(s) containing the drivers and the SourceDisksFiles section must list
; which disk number each file to be copied is found on.
; Disk number 99 is used to avoid a conflict with the disk numbers defined
; in layout.inf
;
; Files used in a driver installation need to be digitally signed otherwise
; installation may fail. See documentation elsewhere in the DDK regarding
; driver signing.
[SourceDisksFiles]
vhidmini.sys = 99
[SourceDisksNames.x86]
99 = %DISK_NAME%,,,\i386
[SourceDisksNames.ia64]
99 = %DISK_NAME%,,,\ia64
[SourceDisksNames.amd64]
99 = %DISK_NAME%,,,\amd64
[DestinationDirs]
CopyFilesSYS = 12 ; should it be 10 to take care of 98 stuff??????
CopyFilesDLL = 11 ; %SystemRoot%\system or system32 - 98 or Win2000
CopyFilesSYS_98 = 10, system32/drivers
[Manufacturer]
%VENDOR%=Vendor, NTx86, NTia64, NTamd64
; For Win2K
[Vendor]
;;%VHidMini% = VHidMini.Inst,
{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE
%VHidMini% = VHidMini.Inst, ACPI\HPQ0004
%VHidDevice% = VHidDevice.Inst, HID\MyVirtualHidDevice
; For XP and later
[Vendor.NTx86]
;;%VHidMini% = VHidMini.Inst,
{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE
%VHidMini% = VHidMini.Inst, ACPI\HPQ0004
%VHidDevice% = VHidDevice.Inst, HID\MyVirtualHidDevice
[Vendor.NTia64]
;;%VHidMini% = VHidMini.Inst,
{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE
%VHidMini% = VHidMini.Inst, ACPI\HPQ0004
%VHidDevice% = VHidDevice.Inst, HID\MyVirtualHidDevice
[Vendor.NTamd64]
;;%VHidMini% = VHidMini.Inst,
{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE
%VHidMini% = VHidMini.Inst, ACPI\HPQ0004
%VHidDevice% = VHidDevice.Inst, HID\MyVirtualHidDevice
[ControlFlags]
ExcludeFromSelect = HID\MyVirtualHidDevice
;===============================================================
; VHidMini (Root Enumerated Hid Device) install section
;===============================================================
[VHidMini.Inst]
CopyFiles = CopyFilesSYS_98, CopyFilesDLL
AddReg = VHidMini_98me.AddReg
[VHidMini.Inst.NT]
CopyFiles = CopyFilesSYS, CopyFilesDLL
[VHidMini.Inst.NT.HW]
AddReg = VHidMini_Parameters.AddReg
[VHidMini.Inst.NT.Services]
AddService = vhidmini,0x00000002,vhidmini_Service_Inst,
[CopyFilesSYS]
vhidmini.sys
HidClass.sys
HidParse.sys
[CopyFilesSYS_98]
vhidmini.sys
HidClass.sys
HidParse.sys
[CopyFilesDLL]
Hid.dll
[VHidMini_Parameters.AddReg]
HKR,,"ReadFromRegistry",%REG_DWORD%, 0x00000001
HKR,,"MyReportDescriptor",%REG_BINARY%, 06, 00, FF, 09, 01, A1, 01, 85, 01,
09, 01, 15, 00, 26, ff, 00, 75, 08, 95, 01, B1, 00, 09, 01, 15, 00, 26, FF,
00, 75, 08, 95, 01, B1, 00, 09, 01, 75, 08, 95, 01, 81,00, C0
[VHidMini_98me.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,"vhidmini.sys"
[vhidmini_Service_Inst]
DisplayName = %VHidMini%
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_DEMAND_START%
ErrorControl = %SERVICE_ERROR_IGNORE%
ServiceBinary = %12%\vhidmini.sys
;===============================================================
; VHidDevice (Virtual Hid Device) install section
; - Only a Null service is installed.
;===============================================================
[VHidDevice.Inst]
[VHidDevice.Inst.NT]
[VHidDevice.Inst.NT.Services]
AddService = ,0x00000002, ; NULL Service
;================================================================
[Strings]
; *******Localizable Strings*******
VENDOR = "Microsoft Corp"
VHidMini = "Root Enumerated Hid Device (sample)"
VHidDevice = "Virtual Hid Device (sample)"
DISK_NAME = "Virtual Hid Device Sample Install Disk"
; *******Non Localizable Strings*******
SERVICE_BOOT_START = 0x0
SERVICE_SYSTEM_START = 0x1
SERVICE_AUTO_START = 0x2
SERVICE_DEMAND_START = 0x3
SERVICE_DISABLED = 0x4
SERVICE_KERNEL_DRIVER = 0x1
SERVICE_ERROR_IGNORE = 0x0
SERVICE_ERROR_NORMAL = 0x1
SERVICE_ERROR_SEVERE = 0x2
SERVICE_ERROR_CRITICAL = 0x3
REG_EXPAND_SZ = 0x00020000
REG_DWORD = 0x00010001
REG_MULTI_SZ = 0x00010000
REG_BINARY = 0x00000001
REG_SZ = 0x00000000
**********
End of inf file Tag: [DTM] Is the device necessary? Tag: 96652
How can I tell if a device is a Bus (or should I)?
I am attempting to write a program that can scan the hardware on a PC
and select the best driver to use. The catch to this is that the
drivers are stored in a folder, but those drivers are "hidden",
meaning the files are encrypted. What I want my program to be able to
do is unencrypt certain drivers when it sees certain hardware ids.
The program that I'm running into is that my scan seems to only be
picking up the root devices and not devices that are on a bus. So
once the bus gets installed, the devices on that bus are still not
being installed.
I was thinking what I needed to do was check each device to see if
it's a bus, and then if it is, to then loop through those children.
Here is a sample of what I'm doing. Please tell me if I'm on the
right track and if I am, how do I check to see if a device is a Bus?
I'm new to the driver world, so bare with me please.
TIA!
--- CODE ---
dil=SetupDiGetClassDevs(NULL,0,0,DIGCF_ALLCLASSES|
DIGCF_PRESENT);
try {
if(dil!=INVALID_HANDLE_VALUE) {
DWORD err = 0;
bool retVal = SetupDiEnumDeviceInfo(dil,cnt,&didat);
if(!retVal) err = GetLastError();
while((retVal) && (err)!=ERROR_NO_MORE_ITEMS)
{
ULONG status, problem;
if(CM_Get_DevNode_Status(&status,&problem,didat.DevInst,
0)==CR_SUCCESS) {
wstrung devstr=L"";
// HardwareID
wstrung hwid = L"";
if(SetupDiGetDeviceRegistryProperty(dil,&didat,SPDRP_HARDWAREID,0,
(PBYTE)itemDesc,512,0)) {
hwid+=itemDesc;
}
if(hwid.size() > 0) {
wstrung triggeredPath;
bool triggerActivated =
CheckForTrigger(hwid,triggeredPath);
if(triggerActivated)
{
triggeredPath = ShowInfFile(triggeredPath);
}
SetupDiBuildDriverInfoList(dil,&didat,SPDIT_COMPATDRIVER);
if(EnumerateDriverList(dil,&didat, &sr)) // This
works fine
{
if(SetupDiSelectBestCompatDrv(dil,&didat)) {
SP_DRVINFO_DATA selectedDrvData;
selectedDrvData.cbSize=sizeof(selectedDrvData);
if(DebugMode) log(L"Getting Selected
Driver...");
if(SetupDiGetSelectedDriver(dil,&didat,&selectedDrvData)) {
DWORD drvdetailsize;
DWORD detailBuf[2048];
SetupDiGetDriverInfoDetail(dil,&didat,&selectedDrvData,NULL,
0,&drvdetailsize);
PSP_DRVINFO_DETAIL_DATA drvdtl =
(PSP_DRVINFO_DETAIL_DATA)detailBuf;
drvdtl->cbSize =
sizeof(SP_DRVINFO_DETAIL_DATA);
if(DebugMode) log(L"Getting Driver Info
Detail...");
if(SetupDiGetDriverInfoDetail(dil,&didat,&selectedDrvData,drvdtl,drvdetailsize,&drvdetailsize))
{
wstrung selectedDriverInfName = drvdtl-
>InfFileName;
toLower(selectedDriverInfName);
for(int i=0;i<sr.PotentialDrivers.size();i+
+)
{
if(sr.PotentialDrivers[i].InfPath ==
selectedDriverInfName)
{
sr.SelectedDriver =
sr.PotentialDrivers[i];
break;
}
}
}
}
}
}
SetupDiDestroyDriverInfoList(dil,&didat,SPDIT_COMPATDRIVER);
bool rebootRequired;
UpdateDriverForPlugAndPlayDevices(0,sr.HardwareID.c_str(),
sr.SelectedDriver.InfPath.c_str(), 0,
&rebootRequired);
}
}
cnt++;
retVal = SetupDiEnumDeviceInfo(dil,cnt,&didat);
}
}
}
catch(...)
{
}
SetupDiDestroyDeviceInfoList(dil);
} Tag: [DTM] Is the device necessary? Tag: 96648
KMDF port driver for IR
Hi All,
The WinHEC 2006 slides for "A Case Study On Designing And Implementing IR
And Remote Solutions For Windows Vista Media Center Systems" refer to a
CIRCLASS driver and a "3rd party CIR port driver". The presentation refers
to documentation at Microsoft Connect but I was unable to find it. Anyone
know where the documentation is?
Also, is IR support availble for MCE 2005? I noticed an IRBUS.SYS driver in
the MCE distribution. Is there documentation somewhere for writing a 3rd
party driver for it?
Thanks,
-Stan Tag: [DTM] Is the device necessary? Tag: 96641