emf
what is this nt emf 1.003,1.006,1.007,1.008. what difference will it make if
i choose
1.003 instead of 1.008. are these formats standard ones or are they
undocumented.
can i develop application that use these formats. why microsoft says that it
has its own spool emf and another emf for for the outsiders?????? Tag: emachine 220 Tag: 75490
SetupDiCallClassInstaller Intiating driver install then failing.
Hi, this question has to with the installation and loading of a driver. The
installation code I've written works great for Windows XP but not for Windows
2K. I used w2k for the building with the latest DDK. There is no hardware
involved so my application calls the Setup API functions to communicate with
the PnP Manager. So the adding of the devices is done when a user adds
another port, not when the user installs the software. These devices are
enumerated in ENUM\ROOT\PORTS.
I have a virtual serial port (Com Port) driver I've written that can have up
to 255 virtual devices. I have the .inf file and the .sys file in a
subdirectory of my application. When I add the first port from my
application it gets to the SetupDiCallClassInstaller function and it is
called. The PnP Manager then loads my driver and calls DriverEntry.
DriverEntry returns STATUS_SUCCESS but the PnP Manager calls my unload
routine right after this. SetupDiCallClassInstaller returns stating a reboot
is required. On Windows XP the AddDevice routine is called after the
successfull call to DriverEntry with no request for a reboot.
If I do reboot then everything works great.
What is different from wxp and w2k in this scenario? Is there something in
the deviceobject that needs to be set. I have Debug Prints in the PnP
dispatch routines and none are being called.
setupapi.log looks like this:
@ 13:54:31.914 : Install Device: Begin.
@ 13:54:31.914 : Doing full install of ROOT\PORTS\0000.
@ 13:54:31.914 : Install Device: Writing BASIC Logical Configs
@ 13:54:31.914 : Install Device: Changing registry settings specified by
INF(s).
@ 13:54:31.924 : Install Device: Writing driver specific registry settings.
@ 13:54:31.924 : Install Device: Installing required Windows services.
@ 13:54:32.785 : Install Device: Writing drive descriptive registry settings.
@ 13:54:32.795 : Install Device: Calling RunOnce/GrpConv items.
@ 13:54:32.795 : Executing RunOnce to process 5 RunOnce entries.
@ 13:54:32.815 : Device install finished successfully (ROOT\PORTS\0000).
@ 13:54:32.815 : Install Device: End.
@ 13:55:02.017 : Device install function: DIF_PROPERTYCHANGE.
@ 13:55:02.027 : Executing class-installer.
@ 13:55:02.027 : Completed class-installer.
@ 13:55:02.027 : Executing default installer.
@ 13:55:15.166 : Device required reboot: Device has problem: 31.
@ 13:55:15.176 : Completed default installer.
Why does w2k require a reboot and not wxp? Problem 31 states that my driver
depends on another driver that is not loaded? My driver is not dependent
upon another driver?
Anyone have any ideas as to what is going on?
-David G Tag: emachine 220 Tag: 75469
Help - creating thread in kernel mode
Anyone can help me how to create a thread in kernel-mode that can write
data to physical user memory?
Thanks
Arcady Tag: emachine 220 Tag: 75465
Question about completion routine for InternalDeviceControl.
Hi, does anyone know how to have the completion routine for
InternalDeviceControl set up properly so that the routine will be called when
the kmdf request object is completed by lower drivers? I set it up according
to kmdf help file and the driver will only execute the routine twice before
device manager will stop the driver completely.
And I used the following two lines
WdfRequestSetCompletionRoutine (Request, completionRoutine, devExt);
ret = WdfRequestSend (Request, Target, WDF_NO_SEND_OPTIONS);
to register a completion routine that just print out the text message and
called
WdfRequestComplete(Request, Params->IoStatus.Status)
to complete the request.
Thanks.
AL. Tag: emachine 220 Tag: 75464
Memory manager writing pages back to executables...
I was reading an article posted in code project website. The author has
noticed that his XP explorer was taking about 5 seconds to display an
error message when he tried deleted a locked file or directory. He
found that shell32.dll was looping around sleep for 5 times with 1
second expiration. So he decided to patch the shell32.dll using a
driver so that it will loop for 0 times thus avoiding the delay.
He writes "Now that we know which addresses to patch, we need to map
those addresses into the kernel-mode area of the memory. This will
allow us to lock the pages in memory, thus preventing them from being
swapped out to disk. In this case the memory we're modifying is
"backed" by shell32.dll. If it were to be swapped out, the memory
manager would attempt to write the changes back to shell32.dll. ...."
He also writes (in the Some Final Thoughts section) "I'm not sure why
the memory manager doesn't try to write the modified pages back to
shell32.dll. I suspect that it's because the entries in the Page Frame
Number Database representing the physical pages we've modified always
have a "reference count" of at least 1 (because they're locked). If my
understanding is correct, this means they will not be moved to the
"Modified List" and thus will not be written to disk by the Modified
Page Writer. If anyone can expand on this, please leave a comment. "
My question is:
1. Is it true that the memory manager will write pages back to the
executable upon modification? Under what circumstance does the memory
manager does this?
2. Where can I find more information about this topic?
The original article may be found at
http://www.codeproject.com/system/NoDeleteDelay.asp
Tom Tag: emachine 220 Tag: 75450
Problems with PREFast DDK 3790.1830 (Win2003SP1)
Hi all.
Yesterday I migrated from DDK build 3790 (I think it's called "Windows
Server 2003 DDK") to the newest build 3790.1830 ("Windows Server 2003 with
SP1 DDK").
Prefast stopped working properly: I have this compiler warning if I run
"prefast build -cefw"
Compiling - driver.rc for i386
cl : warning D4002 : ignoring unknown option '/hotpatch'
which doesn't worry me too much.
The real problem is that Prefast issues some defects, but when I try to run
"prefast view", it spits out a script error:
Line: 422
Char: 2
Error: 'documentElement' is null or not an object
Code: 0
URL:
file://C:\WINDDK\3790~1.183\bin\x86\drvfast\scripts\DefectUI\DefectUI.hta
If I try "prefast list", it fails with this message
-----------------------------------------------------------------------------
Microsoft (R) PREfast Version 1.5.2402 for 80x86.
Copyright (C) Microsoft Corporation. All rights reserved.
-----------------------------------------------------------------------------
Contents of defect log: C:\WINDDK\3790~1.183\bin\x86\drvfast\defects.xml
-----------------------------------------------------------------------------
while creating PREfast.DefectDefs
while creating PREfast.DefectSet
-----------------------------------------------------------------------------
Error 0x800a138f occurred while creating PREfast.DefectSet component:
'documentElement' is null or not an object
-----------------------------------------------------------------------------
I tried the same on another machine with the same DDK, and it works, indeed.
So I think there is something screwed up on my machine.
Any idea where to look at?
Have a nice day
GV Tag: emachine 220 Tag: 75446
What do I have to use to compile DDK samples?
Hi all.
Please help to understand what are the differences between VC++ Standard
and Pro/Enterprice versions?
Can I compile drivers by SE version?
I'm asking this question 'cause I'm trying to compile DDK driver sample and
getting the errors.
If I do this from command line using DDK's build.exe I get the next:
BUILD: Compile and Link for i386
BUILD: Compiling and linking d:\work\msddk\ntddk\src\video\miniport\mirror
BUILD: NMAKE.EXE failed - rc = 2
BUILD: Done Tag: emachine 220 Tag: 75443
Difference between Windows NT 5.0 and NT 5.1 booting process
Hi all,
I'm working on a full disk encryption driver for which I have written a
lower filter to disk driver and some 16 bit assemby program (INT13 hook)
which will initially decrypt all the system files.
All my modules are working fine in Windows 2000 but in Windows XP it crashes
with the following bug check code.
PROCESS1_INITIALIZATION_FAILED (6b)
Arguments:
Arg1: c000007a, Indicates the NT status code that caused the failure.
Arg2: 00000006, (reserved)
Arg3: 00000000
Arg4: 00000000
Is there any differnence in the booting process of Windows 2000 and Windows
XP in terms of reading the data from the disk at boot level.
Developer Tag: emachine 220 Tag: 75438
Understanding NdisMAllocateMapRegisters
Hi
Is it required to call NdisMAllocateMapRegisters before the ndis miniport
calls NdisMAllocateSharedMemory(). (as documented in the ddk)?
Can't the physical address returned by calling NdisMAllocateSharedMemory()
passed to the dma master on the device?
My understanding is - if an Ndis Buffer passed by protocol drivers has to
be mapped directly and passed to the dma master, then a
NdisMStartBufferPhysicalmapping() should be called. To do this, a map
register is required, hence NdisMAllocateMapregisters() should be called
prior to calling NdisMstartBufferPhysixcalmapping().
But if the buffer passed by the protocol driver is copied to a buffer
alloacted using NdisMAllocateSharedMemory(), then NdisMAllocateMapRegister ()
is not required. Please correct me if Im wrong.
basically, What does NdisMAlloacteMapRegisters() do and how and when should
an ndis miniport use it.?
Thanks in Advance,
suu. Tag: emachine 220 Tag: 75430
serial COM port driver
Hi All,
I am working on a project regarding the serial COM port. I have to
design my own protocol for the serial communication. In the protocol
there are some bits for Read/Write, address(bank, offset) and data to
be transferred.
Would anybody please tell me where I can find the Serial COM port
driver, especially the driver that provides the funcation calls/APIs
that allow me to call them by using my own protocol? Thanks a lot for
your help. Tag: emachine 220 Tag: 75425
Help on NDISUIO
hi everyone,
i am doing a school project to obtain network adaptor
information, and i am TOTALLY new with ndisuio. after reading so many
articles here, i managed to use the CreatFile and
NDISUIO_BINDING_DEVICES model to get a list network adaptors in my
laptop... but the returned list is something like
/device/xxxxxxxxxxxxxxxxxxxxxx, a serial strange number so called
adaptor name, i dont understand what is that?
and i am looking for something more specific, like wether it
is a wireless or ethernet card...really dont have a clue on how to do
that..T_T
i am seeking you guys help, seems you all quite pro on this...
Millions of thanks!!!!
Michael
Singapore... Tag: emachine 220 Tag: 75412
CreateFile returns INVALID_HANDLE_VALUE
I'm a newbie playing with implementing the filter control device object that
is described in the Microsoft Q262305 KB article and the Oney book (Chap 16).
I'm working with a USB keyboard driver stack that actually belongs to a
barcode scanner (which provides keyboard scan codes as input). I've
successfully played and manipulated kbfiltr.sys to intercept the barcode
scanner input and put it in a device extension buffer.
I've now spent some time trying to mesh the toaster/filter "control device
object" code with the kbfiltr example. The resulting upper filter driver
compiles and installs. The named "control device object" (MyBarcode) appears
in the Winobj utility's "\Driver" folder. The name also appears in the
!devstack for the device object shown below.
However, when I make the CreateFile call from my user-mode app, it's always
failing. Here's the CreateFile call:
HANDLE hdevice = CreateFile( _T("\\\\.\\MyBarcode"), GENERIC_READ |
GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
Any ideas would be appreciated.
1: One thing I just thought of is that the name of the control device object
is the same as the executable. Do they need to be different names?
2: Do I need to work with IoRegisterDeviceInterface?
lkd> !drvobj kbdclass
Driver object (866982c8) is for:
\Driver\Kbdclass
Driver Extension List: (id , addr)
Device Object list:
862773c8 8604be38 86697900
lkd> !devstack 8604be38
!DevObj !DrvObj !DevExt ObjectName
> 8604be38 \Driver\Kbdclass 8604bef0 KeyboardClass1
862643f8 \Driver\MyBarcode 862644b0
863423f8 \Driver\kbdhid 863424b0
86355ab8 \Driver\hidusb 86355b70 0000005d
!DevNode 86290488 :
DeviceInst is "HID\Vid_065a&Pid_0001\6&3742c807&0&0000"
ServiceName is "kbdhid"
lkd>
When I call CreateFile from my user mode app, however, it fails with
INVALID_HANDLE_VALUE. Here's the CreateFile call:
HANDLE hdevice = CreateFile(_T("\\\\.\\EpiBarcode"), GENERIC_READ |
GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
, though I can't get a valid handle. I'm looking for ideas
My next problem is that Tag: emachine 220 Tag: 75408
Problems with windows installer after ddk
I have installed the latest winddk and now I am having strange
problems with windows installer, when I save my vb project
it suddenly pops up and tries to reinstall the ddk, then it rolls
back. I need to request 'cancel' 3 times to stop this annoying
thing.
Any clues? Tag: emachine 220 Tag: 75403
shutdown handler
All,
I register shutdown handler using IoRegisterShutdownNotification. In my
IRP_MJ_SHUTDOWN handler, I set a value in registry. I clear this registry in
next boot. The problem i am having is this value is being set during a
bugcheck. Is it possible that IRP_MJ_SHUTDOWN handler is called during BSOD
Thanks Tag: emachine 220 Tag: 75400
User mode winmm driver sample needed!
Greetings! I want to write a virtual audio device driver to capture the
sound output of another windows application. I have come across
previous posts in this news group
http://tinyurl.com/862cv
http://tinyurl.com/8ssl6
that suggest writing an old-style winmm user mode driver using a
wodMessage callback. This sounds like exactly what I want.
The problem is that I would really need some working sample code to get
started, otherwise I would have no idea how to structure such a driver.
Even though the MS documentation tells you some things about how to go
about it, I don't quite feel that I get what I need to start writing
code just by reading the DDK help files... I have looked in the samples
provided with win98DDK as well as the latest DDK, but to no avail...
Can anybody point me to, or provide me with some sample code for this?
I would be extremely grateful!
regards
- Jonas Tag: emachine 220 Tag: 75394
Problem with WdfRequestRetrieveOutputMemory
Hello to all,
I'm developing a driver for an USB device using KMDF.
This is my problem (please, evaluate also my approach):
I want my driver to be completely asynchronous, in order to do so, I
process DeviceIOControl requests in this way:
when a new request arrives, I create a new WDFREQUEST using this code:
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&_object_attributes,
MY_IOCTL_CONTEXT);
WdfRequestCreate(&_object_attributes, NULL, &_tx_request);
In the context structure I store original user mode request and an
offset.
I create a new WDFMEMORY object using this code:
WDF_OBJECT_ATTRIBUTES_INIT(&_object_attributes);
_object_attributes.ParentObject=_tx_request;
WdfMemoryCreate(&_object_attributes, PagedPool, MYMEMTAG,
_tx_buffer_size, &_tx_memory, &_tx_buffer);
_tx_buffer_size is larger than original request input buffer because I
need to add some protocol bytes. After, I write the request to bus
driver using this functions:
WdfUsbTargetPipeFormatRequestForWrite(_tx_pipe, _tx_request,
_tx_memory, NULL);
WdfRequestSetCompletionRoutine(_tx_request, _my_tx_completion_routine,
NULL);
WdfRequestSend(_tx_request, WdfUsbTargetPipeGetIoTarget(_tx_pipe),
NULL);
In _my_tx_completion_routine first, I verify if all gone right, if yes:
I've to read device response considering that I have to remove protocol
bytes and some other informations that are not interesting for user
mode application; I use this code (we are always in my 'write phase'
completion routine):
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&_object_attributes,
MY_IOCTL_CONTEXT);
WdfRequestCreate(&_object_attributes, NULL, &_rx_request);
Next, I copy IOCTL context structure received as parameter (it contains
the original user mode request and its response buffer offset):
_new_ioctl_context=WdfObjectGetTypedContext(_rx_request,
MY_IOCTL_CONTEXT);
RtlCopyMemory(_new_ioctl_context, _tx_request_context,
sizeof(MY_IOCTL_CONTEXT));
I create a new WDFMEMORY object that will be used to read from device:
WDF_OBJECT_ATTRIBUTES_INIT(&_object_attributes);
_object_attributes.ParentObject=_rx_request;
WdfMemoryCreate(&_object_attributes, PagedPool, MYMEMTAG, 512,
&_rx_memory, NULL);
Keep in mind tha last code line because I'll return on it later. Always
in my 'write phase' completion routine I attempt to read from device
using this code:
WdfUsbTargetPipeFormatRequestForRead(_rx_pipe, _rx_request, _rx_memory,
NULL);
WdfRequestSetCompletionRoutine(_rx_request, _my_rx_completion_routine,
NULL);
WdfRequestSend(_rx_request, WdfUsbTargetPipeGetIoTarget(_rx_pipe),
NULL);
At this point I free the write request using WdfObjectDelete() and I
leave _my_tx_completion_routine callback.
Once device responds, _my_rx_completion_routine callback is invoked:
from status block I verify that read request was completed fine and
that I received from device the expected amount of data. The 'Request'
parameter is the read request that I've created in my 'write phase'
completion callback; and now, finally, the problem:
before complete the original user mode request, I've to copy to its
output buffer the data that I've received from device excluding
protocol bytes. When I use WdfRequestRetrieveOutputMemory on 'Request'
parameter to parse received data, it always fails due to
STATUS_INVALID_DEVICE_REQUEST error.
But, the stranger things must still arrive; in order to avoid the
problem I have tried the following:
do you remember the WdfMemoryCreate call in _my_tx_completion_routine
callback? If I replace the NULL last parameter with a pointer to a
buffer (in order to store output buffer pointer in the context
structure instead of using WdfRequestRetrieveOutputMemory) a bug check
occurs and my test machine restarts. All parameters supplied to
WdfMemoryCreate are valid (except for the last parameter that is
currently a reference to PUCAHR _buffer=NULL).
It is still not the end: if I bring back to NULL the WdfMemoryCreate
call last parameter, and exacly below I use WdfMemoryGetBuffer, I
obtain a pointer that, once stored in the context structure, when
_my_rx_completion_routine is invoked, stores the data received from the
device. At this point I can complete the original user mode request
correctly.
What's wrong with first attempt using WdfRequestRetrieveOutputMemory?
What I'm mistaking?
Thank you for the patience. Tag: emachine 220 Tag: 75391
STATUS_PENDING returned by lower driver for IOCTL_INTERNAL_USB_SUBMIT_URB
Hi All,
I have the following code (SendAwaitUrb) that I got from W. Oney's
book. I like this book, very useful, a lot of samples, just a great
educational source about USB drivers!
Probably I do something wrong because my IoCallDriver always return
STATUS_PENDING.
I call SendAwaitUrb and IoCallDriver from within my Lower function
filter driver. I attach the filter driver below the function driver and
I am expecting to be able to send Irp with URB to the bus driver.
I am a bit concerned about the code pdx = (PDEVICE_EXTENSION)
fdo->DeviceExtension;
In my filter's AddDevice function I have successfully attached the
filter to the driver stack like this: pdx->NextLowerDriver =
IoAttachDeviceToDeviceStack ( fdo, pdo). I do IoCallDriver in
SendAwaitUrb function like this: IoCallDriver(pdx->NextLowerDriver,
Irp);
I will be very thankful if you can help me identify the error. Here is
the code of the function:
#pragma PAGEDCODE
NTSTATUS SendAwaitUrb(PDEVICE_OBJECT fdo, PURB urb)
{
// SendAwaitUrb
PIO_STACK_LOCATION stack;
IO_STATUS_BLOCK iostatus;
KEVENT event;
NTSTATUS status;
PIRP Irp;
PDEVICE_EXTENSION pdx;
PAGED_CODE();
ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
pdx = (PDEVICE_EXTENSION) fdo->DeviceExtension;
pdx->NextLowerDriver = TopOfStack;
KeInitializeEvent(&event, NotificationEvent, FALSE);
Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_SUBMIT_URB,
pdx->NextLowerDriver, NULL, 0, NULL, 0, TRUE, &event, &iostatus);
if (!Irp)
{
KdPrint((DRIVERNAME " - Unable to allocate IRP for sending URB\n"));
return STATUS_INSUFFICIENT_RESOURCES;
}
stack = IoGetNextIrpStackLocation(Irp);
stack->Parameters.Others.Argument1 = (PVOID) urb;
status = IoCallDriver(pdx->NextLowerDriver, Irp);
if (status == STATUS_PENDING)
{
KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL);
status = iostatus.Status;
}
return status;
}
// SendAwaitUrb
Best regards,
Dim Tag: emachine 220 Tag: 75389
Cancelling Jobs in unidrv architecture
Hi
I am developing a unidrv based printer driver for Windows XP for which
i have written the rendering plugin, ui plugin and the Language Monitor
plugin apart fron the gpd file.
I would like to handle cancelling of jobs from the spooler queue. What
would be the best way to go about it? Will i have to implement the
Print Processor for this??
Thanks in advance.
Chaitanya Tag: emachine 220 Tag: 75383
USB RNDIS custom OID
Is is possible to send/receive vendor defined data over the control channel?
E.g. for a user-mode application showing some device/system specific
information.
Do I need to provide hardware for driver signing?
Leo Havmøller. Tag: emachine 220 Tag: 75382
SoftIce and WinXP SP2 CHECKED
Hi,
I have some problem with running SoftIce (Driver Studio 3.2) on Windows XP
SP2 MUI CHECKED. I try run SoftIce (Ctrl + D) but appears very strange
SoftIce window. After close this window Windows frozen - all not work
(keyboard, mouse). SoftIce from Driver Studio 2.7 work good but not work TAB
key (for completion symbols names).
Thanks. Tag: emachine 220 Tag: 75380
Q) Is it possible to change the link speed/duplex
Hello all,
I'm working on windows XP Ethernet D/D.
My question is little bit related with the IEEE spec, but please answer for
that.
Q) Regarding to Ethernet Phy, is it possible to change the link speed/duplex
without the link dis-connecting?
I'm afraid of my Ethernet_Phy¡¯s indicating the link speed/duplex changing
without any link dis-connecting.
Thank you.
// Daum. Tag: emachine 220 Tag: 75374
SdBusSubmitRequest() CMD53 Multiple Block Read/Write
Hi,
I am working on a driver using the SDIO interface on Windows XP. With
SdBusSubmitRequest() cmd53, the driver gets okay from the SD bus stack,
but anything after 64 byte is garbage. I checked to make sure that
block size setting for the function is set correctly. Is anyone else
experiencing the same problem?
Thanks,
Chun Tag: emachine 220 Tag: 75373
Installing COM server from printer driver INF file.
Hi,
I'm trying to install and register COM server from printer driver INF file
using
RegisterDlls directive.
In INF File, I copy dll to Windows system folder and register.
AddPrinter successfully copies dll to WIndows\System32 folder.
But it is simply ignoring RegisterDlls directive. It did not register COM
server.
RegisterDlls = REGISTER_COM_SERVER
[REGISTER_COM_SERVER]
11,,myserver.dll,1
Any Idea?
Thanks
Charles Tag: emachine 220 Tag: 75370
Q) Ethernet Duplex mismatch.
Q) Ethernet Duplex mismatch.
Dear all,
I'm playing with an Ethernet device driver at WinXP.
In some cases, it has a duplex mismatch(See below).
Who is responsible fot that mal-function? My machine(Ethernet_A) or the
other machine(Ethernet_B)?
By any chance, is it from lack of IEEE standard.
Thank you.
// Daum
=== Below =====
Ethernet_A(Playing) <----------> Ethernet_B(The other end point)
Setup Operate_mode Setup Operate_mode
AUTO ==>100M_F AUTO ===> 100M_F
AUTO ==>100M_H 100M_F ===> 100M_F Tag: emachine 220 Tag: 75369
USB ISO CRC-16 handling
I have some design questions related to USB ISO stream error handling.
It is well understood that Isonchronous USB streams are not guarenteed
to be error free. I long assumed that this means that they are not even
error detected. I assumed that the protocol parts of the USB packets
(PID, etc) where checked by the host controller and if there were errors
in that USBDI would set and error code in the Status field of the
USBD_ISO_PACKET_DESCRIPTOR. I had further assumed that errors in the
data part of the packet were my responsibility to discover. Thus when
designing an internal packet format for a device using isonchronous
transport to send data to the host, I included a checksum in the packet
header so the driver could validate the header information.
Now I am looking more carefully at things and I realize that there is a
CRC-16 field used to guard the data portions of ISO transfers. The usb2
spec in section 8.3.5 states that this CRC will give 100% coverage of 1
and 2 bit errors and that the host controller cacluates these checksums
as it receives packets and will reject a packet that fails the CRC. And
of course I now see that there is a USBD_STATUS_CRC error code (duh - if
it was a snake it would have bitten me) that I assume is set when the
host controller detects a CRC error.
My question is two-fold. First, I am now thinking that if I recieve a
completed "in" transfer that is marked as USBD_STATUS_SUCCESS I can
assume that the host controller has validated the CRC-16 and thus all
the data for that packet is valid within the bounds of the CRC-16 as
described in 8.3.5. Thus I can toss my checksum in the data and blindly
assume the contents of the data is valid. Is this correct?
Secondly, USBD_STATUS_CRC has the "stall bit" set (i.e.
USBD_STATUS_HALTED). As I understand it the pipe will have to be reset
if I get this error (or perhaps after some number of errors within a
URB - I seem to recall reading this somewhere, though I cannot find it
now). Is this correct? And if so, is this not kind of harsh for
something that is more or less supposed to happen from time to time
anyway? I see many places where it is said you should not use ISO pipes
if your application cannot tolerate occasional transmission errors. So
given the choice of an ISO pipe I would think that it is implied that
occasional errors are tolerable. In such a case I think it would be
incumbent on the driver to handle such troubles and that USBDI would
simply mark the error but otherwise not interfere with the state of the
stream. But yet this does not seem to be the case. Am I misreading
things or is there some way to decrease the sensitivity of USBDI to
transmission errors when dealing with ISO pipes?
Best regards,
Tom Udale Tag: emachine 220 Tag: 75367
Creating Custom Printer Settings/Preferences
I need to provide a custom interface for my printer driver when the
user clicks the 'Preferences' button. Right now the GPD file controls
the appearance by loading the standard interface. I would like my own
set of dialog boxes to show up when the 'Preferences' button is clicked
but am having a hard time finding that information. Can anyone point me
to a good resource for that information?
Thanks.
--
Steve Tag: emachine 220 Tag: 75358
Creating Custom Printer Settings/Preferences
I need to provide a custom interface for my printer driver when the
user clicks the 'Preferences' button. Right now the GPD file controls
the appearance by loading the standard interface. I would like my own
set of dialog boxes to show up when the 'Preferences' button is clicked
but am having a hard time finding that information. Can anyone point me
to a good resource for that information?
Thanks.
--
Steve Tag: emachine 220 Tag: 75357
Q) Will WinXP and Win2K support to reduct I/O-port by Registry Setting?
Q) Will WinXP and Win2K support to reduct I/O-port by Registry Setting?
Hello everyone,
I'm developping PCI/CardBus device driver at Win2K/XP.
I heard that there is a mechanism to reduct I/O-port by Registry Setting
like below in the device driver¡¯s INF file:
[DDInstall.HW]
Include=machine.inf
Needs=PciIoSpaceNotRequired
Wil thel WinXP and Win2K support this mechanism?
have a nice day.
Thank you.
// Daum Tag: emachine 220 Tag: 75353
Disk Class Upper Filter - FILE_REMOVABLE_MEDIA
Using the DDK samples (toaster, diskperf), I've been able to write a basic
disk class upper filter. I would like to correctly determine if the device
is removable media (i.e. usb thumb drive, iPod, etc).
If my filter driver is added before PartMgr in the UpperFilter reg value,
the below code works correctly. If it's listed after PartMgr,
FILE_REMOVABLE_MEDIA is never set in my filter device's characteristics. Is
this expected? Can I get this info elsewhere, or do I need to control the
order of the UpperFilters?
From the toaster filter example (IRP_MJ_PNP -> IRP_MN_START_DEVICE):
// On the way up inherit FILE_REMOVABLE_MEDIA during Start.
// This characteristic is available only after the driver stack is started!.
if(deviceExtension->NextLowerDriver->Characteristics & FILE_REMOVABLE_MEDIA)
{
DeviceObject->Characteristics |= FILE_REMOVABLE_MEDIA;
}
**** Any info or pointers would be greatly appreciated. Thanks Tag: emachine 220 Tag: 75352
suspend/resume via activesync
Is there a way to programatically (c++) suspend and resume a device via
activesync, or by uploading a program to the device and then executing it
through activesync? Tag: emachine 220 Tag: 75346
MouseFilter
Hi
I need to get a filter running where i can add my own mousepackets to the
mouse from a usermode program.
One of the things i want with the driver is to start and stop it runtime.
So first i wanted to get the moufiltr example from DDK running as an
upperfilter with the help of an inf file but somehow i cannot get it to
work. I tryed to register it as an Class driver for all mouse and i made a
service.
Only when i start the service from my application with startservice it gives
me an error code and the service doesn't run.
With the help of some lecture i went to see at the device manager at the
mouses but when i look at the option "class upper filters" it doesn't give
me any info on if moufiltr is hooked on the mouse. I do see mouclass hooked
on it at the upper class filter.
My question is , can i run the filter this way or do i need to do it in a
different way?
Thx Tag: emachine 220 Tag: 75345
share memory between user and kernel?
Is possible to share memory between user and kernel? I am copying data into
IRPs. But user thread isn't fast enough so I accumulate a lot of data in
kernel. If I can somehow copy the data into a shared memory then I don't
need to worry about slow read IRPs.
Thanks,
Ning Tag: emachine 220 Tag: 75343
finding the driveletter of a disk drive
Hello,
I use CreateFile() and "PHYSICALDRIVEx" to list disk drives, but how do I find the driveletter (assuming each disk has one
partition) ?
thx Tag: emachine 220 Tag: 75339
USB and IOCTL_PAR_QUERY_DEVICE_ID in language monitor gets errors
Trying to use a USB to parallel adpater to communicate with a printer.
Ocassionally get an error in the language monitor on a call to
pIniPort->fn.pfnGetPrinterDataFromPort for IOCTL_PAR_QUERY_DEVICE_ID.
GetLastError: [23]-Data error (cyclic redundancy check).
Once this error occurs, the printer does not respond and all subsequent
language monitor calls get the error. The error does not clear until the USB
cable is disconnected and reconnected, where the printer then responds.
What is causing this error and is there a way to clear this error from a
language monitor in order to continue operations?
The MSDN documentation indicates that the query for
IOCTL_PAR_QUERY_DEVICE_ID is supported by USBPrint.sys and that a PJL
language monitor that supports this query is compatible with USBPrint.
I also tested IOCTL_USBPRINT_GET_1284_ID and got the same results.
Any advice on this is greatly appreciated.
Thankyou
DaveK Tag: emachine 220 Tag: 75332
IoGetDiskDeviceObject
Dear all,
In my FsRegistrationNotification callback I call IoEnumerateDeviceObjects
for each file system and use IoGetDiskDevice to identify mounted volumes in
the device object list. Is it safe to assume that if IoGetDiskDeviceObject
succeeds that the device object is a volume that I can filter? I ask this
only because in the sfilter example they do it a slightly different way, I
just wondered if my method is a safe shortcut. My target OS is XP onwards, I
know that this wont work on W2K, but that is fine.
Thanks in advance,
Carly Tag: emachine 220 Tag: 75327
NdisInitializeTimer or NdisMInitializeTimer?
NDIS documentation says that miniports should use
NdisMInitializeTimer, and NdisInitializeTimer is for protocols.
However the netvmini sample uses NdisInitializeTimer.
Since I've already learned that DDK samples prevail over documentation...
have the rules changed? Can miniports use NdisInitializeTimer instead of
the M version?
Regards,
--PA Tag: emachine 220 Tag: 75325
What is reverse of WdfSpinLockCreate ?
Following the recent discussion on recycling NDIS spinlocks, I've looked
for API to free the WDK timer, but could not find it.
Is there a function to "free" or "uninitialize" a timer created
by WdfSpinLockCreate ?
Back to NDIS 5/6: what is the function (or macro) to "free" a timer
created with NdisMInitializeTimer or NdisInitializeTimer ?
Regards,
--PA Tag: emachine 220 Tag: 75323
win2k audio class driver issue
Hi
We have a composite usb 2.0 device ( having video & audio functions).
The device works absoultely fine on Windows XP with SP2 with standard class
drivers. But when the device is connected to a win2k system with SP4, the
video function works fine but the audio function doesn't.
When the device is connected to system with just usb 1.1 support (windows 2K
without SP4), the audio works fine.(uses the standard audio class driver, but
1.1)
Is there a known problem with the audio class driver of windows 2k SP4?
Do we need to develop a properitary driver for 2.0 audio device?
Thanks in advance.
~suu. Tag: emachine 220 Tag: 75320
Cleaning up registry after IM driver crash
Hi, I have following problem with IM driver development:
When driver crashes before it can be normaly uninstalled, I boot another
system on the same machine and delete system32\driver\mydriver.sys .
Because it is not correct way for uninstalling in registry stays some data
and on every system start "New Hardware" dialog appears.
When I see into Device Manager, all installed and crashed drivers I see in
NIC section like:"DriverName Miniport #number" with yellow exclamation.
When I try to uninstall it from device manager, it says:
"Failed to uninstall device. This device may be required to boot up the
computer."
So after some time number of these not functional devices is high.
Before some time I had tried to solve it and clean all registry keys with
information about this not functional device, but it's not simple, probably I
forgot something or I deleted something good and must reinstall all
machine...
Does exist way to set somewhere startup type for these not functional
devices and then to uninstall them by correct way ?
Or some other trick how to remove these devices ?
Peter Tag: emachine 220 Tag: 75319
who do you enumerate all the current installed drivers...
I would like to write a console application that lists all the
currently
installed drivers.
I have a vague notion that this involves using serveral functions
for the system dll ntdll.dll
could someone offer some advice.
thanks.
black_13 Tag: emachine 220 Tag: 75311
accesing drivers on different IRQ levels
Hey team.)
There's a perticular problem with the driver I am developping.
My main driver runs at passive and the other one at higher - looks like apc
or even device. I can only access a function that doesn't give me IRP
but has the important data that the main driver should receive.
How do I transfer that the fastest way. I created a thread in main drv. that
waits for events but that goes very slow and async occurs.
When I use KeWaitXXX in higher level drv - machine most likely restarts.
The best way would be to disable the other interrupt, handle sync/transfer
and enable it again. But I don't know how.
What would you suggest. Big thanks for answers.
Eric Tag: emachine 220 Tag: 75304
About Converting/Type casting from USHORT to PVOID.
Respected Sir,
I have defined variable "myvar" as USHORT myvar[2]; . I have
a problem in converting the variable "myvar[0]" of type USHORT
to type-casting of PVOID type. I have tried converting through
following manner :-
(PVOID) myvar[0]. But this doesn't work ? So, Now, What I want from you is,
please some one tell me as to how can I safely convert the variable to type
PVOID in
correct and portable manner too ?
regards,
sd Tag: emachine 220 Tag: 75296
DDKBUILD version 3.13 released.
The latest released version is 3.13. This version adds quiet mode -
the script attempts to reduce all output to stdout to the minimum,
simplifying the use of ddkbuild in automated build procedures. Credit
goes to Beverly Brown at Mercury Computer for the quiet mode
implementation. The Vista DDK (build 5270) is supported. WDF (KMDF1.0)
is released and 3.13 supports that as well. DDK's going back to the
Windows 2000 DDK continue to be supported. Visual Studio 2005 is
supported.
In addition a lot of bugs have been fixed. Bug fixes were suggested by
Daniel Germann, Thomas Schimming, David Craig, Norman Diamond and
probably other people I forgot about.
http://www.hollistech.com/Resources/ddkbuild/ddkbuild3_13.zip
Using ddkbuild with Visual Studio .NET:
http://www.hollistech.com/Resources/ddkbuild/ddkbuild.htm
=====================
Mark Roddy DDK MVP
Windows Vista/2003/XP/2000 Consulting
Device and Filesystem Drivers
Hollis Technology Solutions 603-321-1032
www.hollistech.com Tag: emachine 220 Tag: 75280
Who is the parent? (IRP_MJ_INTERNAL_DEVICE_CONTROL)
Hi All,
I am using USBBuildVendorRequest to format an URB and then send the URB
to the bus driver. In case of XP this will be generic parent driver,
for Win2K this is usbhub.sys.
I am sending these urbs successfuly if I am inside a function driver.
The parent driver for a function drivers is the generic parent/bus
driver.
It happens that I cannot modify officially the function driver code and
I have to use the driver as it is. I am implementing an upper function
filer driver. Using the same mechanism for sending urbs my code into
the filter's custom IOCTL handler looks like this:
// Create the URB
urb = (PURB)ExAllocatePool(NonPagedPool, sizeof(struct
_URB_CONTROL_VENDOR_OR_CLASS_REQUEST));
UsbBuildVendorRequest(
urb,
URB_FUNCTION_VENDOR_DEVICE, sizeof(struct
_URB_CONTROL_VENDOR_OR_CLASS_REQUEST),
0,
0,
0,
0,
0,
IoBuffer,
NULL,
InputBufferLength,
NULL);
// use the original irp as an internal device control irp
nextStack = IoGetNextIrpStackLocation(Irp);
nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
nextStack->Parameters.Others.Argument1 = (PVOID) urb;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
...
ntStatus=IoCallDriver(deviceExtension->TopOfStackDeviceObject, Irp);
My question is if this internal IOCTL will ever reach the generic
parent/bus driver?
Is this a general mechanism to talk to the generic parent/bus driver
from any place in the device stack above these driver - say upper
function filter, function, lower function filter drivers?
What if I place my driver as a lower function filter driver - in this
case it will be nearer to the generic parent/bus driver?
Thanks in advance!
Dim Tag: emachine 220 Tag: 75274
Is any difference between CL/LINK in SDK and that in DDK?
Just for a test. I use the VC7.1 IDE to build the kernel driver with
"include" and "libpath" correctly set to DDK files. And the build succeeded.
So I don't see any difference between CL/LINK in SDK and that in DDK. So If I
already have Visual Studio 2003, why should I still use build utility
suggested by MS? Tag: emachine 220 Tag: 75266
Is any differernce in cl between SDK and DDK
Just for a test. I use the VC7.1 IDE to build the kernel driver with
"include" and "libpath" correctly set to DDK files. And the build succeeded.
So I don't see any difference between CL/LINK in SDK and that in DDK. So If I
already have Visual Studio 2003, why should I still use build utility
suggested by MS? Tag: emachine 220 Tag: 75265
RtlInitializeGenericTableAvl and header File
which header file has the declarations for RtlInitializeGenericTableavl
and other RTLxxxAVL functions ?
I just did a search on the latest DDK and I cant find it. I know about
RtlInitializeGenericTable and the corresponding ones but I came to know
about AVL tree and I intend to use that data structure.
Thanks. Tag: emachine 220 Tag: 75261
Hi All
I need the "special" drivers (video etc.) for the above - tried most
places - any clues/help?