IM Driver Crash at system startup
I am writing a IM driver which put received packets into
a queue and indicates it up. Most of the time it runs
fine but it seems that when I have the driver installed
and reboot it, it crashes when at
NdisMIndicateReceivePacket when I am trying to indicate a
UDP packet.
I havent got much clue on this, I have looked at NDIS.com
and it says something about the first buffer have to
describe MAC Header and LookaheadData. How can I find
these? Tag: my first article Tag: 27821
scsi timeout at boot
Microsoft Knowledge Base Article 139357 describes how
some scsiport drivers can produce a timeout message when
the windows OS is booting. It describes that the timeout
is caused by a MODE_SENSE command being issued by the
scsidisk.sys driver with a timeout value on the I/O being
0.
It describes the problem as being only applied to windows
NT 3.5 (Workstation/Server). My problem is that the
driver I'm currently working with is exhibiting the exact
same problems as described by this article but on the
windows NT/2000 environments. Is it just that this
article isn't up to date and my timeouts are symptomatic
of something else.
The timeouts only occur during the OS boot and the driver
and the hardware function normally outside of this.
Can anyone offer some insight?
Thanks Tag: my first article Tag: 27815
GPD for printers
Can I modify the GPD for a printer without resetting the computer? Can
a simple GPD directive such as '*MaxCopies 1' cause a printer to hang?
I am asking cause I added that simple directive to our LaserJet
printer GPD file and we are experiencing slight difficulties. Tag: my first article Tag: 27810
How the miniport works?it's so important for me.
i just touch the miniport program. I am wonder how can i
get data from adapter driver using my miniport driver? who
can tell me? it's so important for me. Tag: my first article Tag: 27809
1394 virtual device
I have a medical device which receives Async commands from an App
running on Windows2000. Windows 2000 App used modified 1394diag driver
and Microsoft Windows stack.
Now I want to move to Windows XP and Microft XP Windows 1394 stack
and driver similar to 1394diag. Do I need 1394 virtual device. (like
1394vdev.sys). When I have actual 1394 device connected, why should I
again create 1394 virtual device. Should I make any changes in INF and
configRom of device.
For one 1394 device to talk with XP, do I need two drivers, virtual
and actual driver. Can someone make me understand this? Where can I
find info for this?
Why should installing driver in XP be different from 2000 for pnp
devices like 1394. Tag: my first article Tag: 27801
user mode plug and play
Hi,
How do i Post Plug and Play events to Drivers.
I know of an undocumented api zwControlPlugPlay in
kernel32.dll, but the parameters are mysterious
Thanks,
Raz Tag: my first article Tag: 27796
WriteFile(...) to USB HID: why does this call hang my client application ?
Hi,
I'm experimenting with some home-made HID-class USB device.
All is well with the ReadFile calls to read report.
The queuing and blocking mechanism is clear to me.
But I'm stumbling with some issues when sending
reports with WriteFile. I never get any error
results ( WriteFile() returns a non-zero value ),
but sometimes the call just doesn't return,
and requires me to kill my application.
Any idea why this would be happening ?
Reducing the frequency of calls to WriteFile seemed
to help a bit, but did not solve the issue.
My calls to WriteFile always follow a successful
call to ReadFile, and I do not see what else I
could/need to do to avoid overflowing the output queue.
So what is going wrong ?
Any idea about something I could be trying ?
Thanks in advice for any hint or directions,
Ivan
NB: I'm running Win2k SP 3
--
Ivan Vecerina, Dr. med. <> http://www.post1.com/~ivec Tag: my first article Tag: 27795
Shared Memory between User app and Driver
Hi
I want to create a shared memory interface between a user
application and a NDIS miniport driver. The purpose of
this interface is that the driver continuosly writes some
information to the shared memory which accesses this
information periodically.
Could you please suggest the best way of doing this ?
Thanks in advance
Ankush Tag: my first article Tag: 27788
1394 async broadcast
I want to send a 1394 Async broadcast packet (nodeId = 0xFFFF) using
Micorsoft Windows stack. But didnt find the way to do it.
DDK for REQUEST_ASYNC_WRITE says " The driver only must fill in the
IA_Destination_Offset member of u.AsyncWrite.DestinationAddress; the
bus driver will fill in the IA_Destination_ID member ".
Since I have no say on nodeId, I dont know how to a Async block
request as broadcast packet of nodeId 0xFFFF. Do I need to send to all
nodes, one node at a time and "feel" like I broacasted. Any help
appreciated. Tag: my first article Tag: 27787
symbolic link and IoGetDeviceObjectPointer
Hello all,
I have a problem with drivers calling each other. There are 3 drivers. Two
of those drivers need to ask driver nr 1 some things.
Nr 1 does the following in his AddDevice method:
RtlInitUnicodeString(&devname, L"\\Device\\NAME");
RtlInitUnicodeString(&win32DeviceName, L"\\DosDevices\\NAME");
IoCreateSymbolicLink( &win32DeviceName, &devname);
Nr 2 and 3 then try:
RtlInitUnicodeString(&devName, L"\\Device\\NAME");
status=IoGetDeviceObjectPointer(&devName, FILE_ALL_ACCESS, &fileObj,
&devObj);
The problem is that nr 2 does this first (but definitely after the addentry
method of nr 1), but always gets c0000e as error code (device not found). Nr
3 first has to load some files and asks stuff to nr 1 later (and he IS
successfull).
In other words: there seems to be a delay between the IoCreateSymbolicLink
and the time when the driver can actually attempt to get a handle to it.
(Note: I'm a newbie, so forgive me if I say stupid things :-)
Is this true? Can I alter the loading order, so nr 2 is called after nr 3 (I
don't think so, both are PnP drivers and I think I read you can't specify a
load order)?
thx in advance for all help,
crimson13 Tag: my first article Tag: 27783
WHERE TO FIND THE DDK? PRINTERS DDK?
I need a copy of the DDK, particularly for printers. It provides stuff
like code for localspl.dll. MS does not provide this on the web-site.
Anyone know where I could find this? Even better, any chance I could
get it emailed? My driver development for the printer is pretty
advanced (have written a port monitor), but I cannot progress without
the DDK. Tag: my first article Tag: 27779
Wakeup problem with PCMCIA card
I am writing a WDM driver for a simple PCMCIA card and testing it under
Windows 2000/SP3.
The driver is based on a framework created with Walter Oney's WDM Driver
Wizard. In particular, the Power handling functions are more or less
unchanged.
My problem is, that when the system wakes up from standby mode, Windows
thinks that the hardware has changed and starts the New-Hardware-Wizard.
The driver appears to complete the processing of the power IRPs, but then
receives a IRP_MN_SURPRISE_REMOVAL request, following which the driver is
unloaded.
The New-Hardware-Wizard indicates that it has detected a device named
MTD-0002. I have been advised that this probably means that Wihdows is
unable to read the Card Information Structure (CIS) on the PCMCIA card, but
I can see no reason why this would be the case.
I have set D3Latency parameter to 1000 (100ms) which should be more than
enough.
On inserting the card into the slot, Windows never has any difficulty
reading the CIS, so I don't see why there should be a problem when it is
powered up on leaving standby mode.
Does anybody have any idea what could be causing this effect? I would be
grateful for any help.
Thanks in advance
Phil
(By the way, this is newly developed hardware and the error could be in the
CIS. It is not a big problem for us to reprogam this memory.) Tag: my first article Tag: 27775
how to display bitmap on screen constantly?
Hi,
I'm trying to find a way to display a bitmap on the top-
right portion of the screen at all times, even when an
application using directx in full-screen mode is in use.
Can this be accomplished using display filter drivers? I
was thinking of writing a driver that would simply map the
bitmap data to the screen along with the rest of the
screen data. So, could a filter driver be
installed "below" GDI and Directx that would map the
bitmap regarless of wich interface(gdi or directx) is in
use? And if so, since GDI and directx are different
components that each communicates directly with the video
adapter (as I understand it), will the driver have to be
device specific? Anyway, if u guys know a way to
accomplish this bitmap mapping whitout using drivers i'll
be more than happy to hear it. Tag: my first article Tag: 27768
WMI support for Stream minidriver
Hello, All.
Does anybody knows how to implement WMI support in the
StreamMinidriver for KernelStreaming.
--
Andrey Tag: my first article Tag: 27766
PCI Configuration Space - BAR0 Allocation
Hi,
Who is responsible to provide IO Address at BAR0 in PCI Configuration Space
: Operating System or Device Driver ?
If OS provides that, can device driver change this ? or does driver needs to
change this to allocate new IO range under conflicts ?
Thanks & Regards,
rsec07 Tag: my first article Tag: 27756
How to install NT4 driver by setup program
I can use inf file to install a "SCSIAdapter" driver on NT4. However,
I want to implement setup program(InstallShield) to install driver.
Except copy *.Inf and *.sys to \\WINNT\\INF and
\\WINNT\\SYSTEM32\\DRIVERS, what application I need to execute to
install driver successfully?
Thanks
Axel Tag: my first article Tag: 27749
Enable/Diable Device Driver from Non-Admin account
In our Video Conferencing systems, we have multiple propritary drivers
running on the system and also our system works with different third
party Conferencing Devices. Obviously differnt drivers for variety of
HW devices are running on the same system. Our recent version of HW is
getting problems with one of HW that is colloborated with our unit.
Then I played with different drivers and finally I found a way to make
it work. Disable the HW unit driver before reboot and enable after the
system booted completely using Windows ddk api from one of test app.
But the Microsoft documentation is expalaining that these APIs for
Enable/Disable, SetupDiChangeState, is only for Administrator group.
Is there any way to disable / Enable the Drivers when we login as a
Non-Admin also.
Can somebody to help to solve this problem. If I am following the
wrong way, Can you update me the proper way to solve this issue.
Thank You
Murthy Tag: my first article Tag: 27743
sub-optimal performance through CardBus controllers on Windows
Problem Statement
- The Windows XP and 2000 driver in the OS for CardBus controllers are not
programmed for optimal throughput or performance.
Observations
- We have a Network adapter that runs roughly the same speeds as a Fast
Ethernet NIC.
- We can sustain data rates in the Tx and Rx directions (simultaneously) of
roughly 80Mbps through the NIC and Ndis driver across PCI.
- When running through a Cardbus controller programmed by Windows (with the
Windows provided Cardbus controller drivers) we see Rx rates of
approximately 78 Mbps. Tx rates top out at roughly 38 Mbps.
- We have noticed that the Cardbus bridge is NOT programmed for optimal
performance, even though the PCI configuration space shows settings that the
CardBus controller driver seems to be ignoring. For example, burst read and
write were set in the PCI config space for the card (MBURSTDN and MBURSTUP)
but the CardBus controller is NOT programmed to burst by the Windows OS
CardBus controller driver.
- When we manually change the cardbus controller to enable bursting, the Tx
performance improves dramatically.
Questions.
1. Can the Network card do anything to influence the Windows Cardbus
controller driver to enable Burst read and write ?
2. Are there other settings the Network card can use to ensure the Cardbus
controller is set for optimal performance?
3. The Fast Ethernet NICs must have run into this same problem already. We
see that that off the shelf Fast Ethernet NICs also are not running anywhere
near optimal performance / throughput. We see simliar rates for Tx and Rx
on with Fast Ethernet Cardbus NICs. We can program the CardBus controller
maually to dramtically improve the performance but we still do not see what
we would expect (90+ Mbps in both directions).
Below are some detailed notes about our investigation and characterization
of the problem.
We are doing performance characterization on our Cardbus NIC, which has a
PHY throughput roughly equivalent to a Fast Ethernet NIC (approximately 100
Mbps simultaneously for Tx and Rx). But, we are seeing some performance
issues, while transferring data across the Cardbus interface. We have not
been able to get the Cardbus interface, on any laptop to transmit data at
rates higher than 37 Mbps and receive data across the Cardbus interface at
rates higher than 78 Mbps. Also, there are some laptops where the upstream
througput is as low as 3 Mbps and the downstream throughput only 7 Mbps. The
throughput seems to vary with the part no. of the Cardbus Controller, being
used in the laptop. Following is a list of observations that we made while
running the tests, with each laptop:
1. Sony Vaio Laptop running Win2k with RICOH 5c475 II Cardbus controller:
This laptop showed a throughput of 37 Mbps upstream and 78 Mbps downstream,
when we transfered data at roughly 100 Mbps at the PHY layer.
2. Dell Latitude laptop running WinXP with the TI PCI-1420 Cardbus
controller: This laptop showed a throughput of 37 Mbps both upstream and
downstream, when we transfered data at roughly 100 Mbps at the PHY layer.
3. IBM Thinkpad running WinXP with the TI PCI-1510 Cardbus controller: This
laptop showed a throughput of just 3 Mbps upstream and 7 Mbps downstream,
when we transfered data at roughly 100 Mbps at the PHY layer. When we
monitored the Cardbus transactions on a logic analyzer, we saw that although
the controller was allowing DMA bursts, it was issueing a lot of retries, to
the device.
4. If we replace the NIC with an out of the box Fast Ethernet NIC, we see
strikingly similar numbers in all cases.
All the above setups are running the standard Cardbus controller drivers
which came with the Operating System and we are running standardout of the
box NDIS Miniport drivers, to drive our NIC. So, the question is, how can we
get the Cardbus controller drivers on each platform and OS, to configure the
controller correctly, to allow maximum throughput across the Cardbus
interface ?
Programming the TI Cardbus controller manually
Since, the datasheets for the RICOH controllers, are not available online,
we looked at the Cardbus configuration registers, of only the TI
controllers.
Following was the default configuration on both the TI controllers on the
WinXP laptops:
1. The MBURSTDN and MBURSTUP bits (bits 15 and 14) were set in the System
Control Register (PCI Config space offset 80h), for bursts, both for Read
and Write transactions.
2. The POSTEN bit (bit 10) in the Bridge Control Register was set, enabling
write posting, which is recommended for good performance while bursting.
3. The Latency Timer settings are different on the controllers:
TI Controller Latency Timer Cardbus Latency (Secondary Bus Latency)
PCI-1420 20 20
PCI-1510 40 B0
4. The KEEPCLK bit (bit 1) in the System Control Register was cleared, which
implies that usage of the CLKRUN protocol was enabled, although we implement
the CCLKRUN# pin as a NO-CONNECT on our device, since it was decided not to
support this protocol. I tried running the tests, after toggling this bit,
so that the Cardbus clock is always kept active and is not throttled using
the CLKRUN# protocol, but that did not improve the performance, in any way.
5. The PCIRETRY and CBRETRY bits (bits 7 and 6), in the Retry Status
Register, are set, indicating that PCI and Cardbus retry timeout is enabled.
Following was the configuration of our device:
MIN_GNT = 18
MAX_LAT = FF
Latency Timer = F8
While running WinXP, we got a similar low throughput of 19 Mbps.
Subsequently, looking at the Cardbus Controller registers and we found that
again the MRBURSTUP bit was not set by the XP CB controller driver. So,
after setting this bit, manually, I was able to acheive an upstream
throughput of 51 Mbps.
This strongly suggests that the Microsoft WinXP Cardbus controller drivers
are not optimized setting the Controller hardware for optimum performance
basedon the parameters of the CardBus cards plugged into the bridge. We are
wondering if other NIC vendors would have run into the same issues on
Windows and got some fixes from Microsoft.
Following, we were able to achieve a new performance high on our Cardbus NIC
using the Dell Latitude laptop with the TI PCI-1420 Cardbus controller. We
were able to acheive 46 Mbps upstream and 79 Mbps downstream, while trying
to transmit packets at roughly 100 Mbps. So, we are almost at par with the
Cardbus Fast Ethernet performance, seen on the various laptops. The
differences this time are:
1. This NIC is programmed with a new EEPROM image which programs the PCI
MIN_GNT, MAX_LAT and the latency timer to values optimized for the maximum
throughput.
2. Before we started this test, we made sure that the PCI latency timer
values on all the intermediate PCI-PCI bridges and PCI-Cardbus controller,
was set to the max possible value of 0xF8 (since I found that the latency
timer values on some of the intermediate bridges was set to zero, by
default, which might have inhibited the Cardbus performance).
---
Larry Cawley
Airgo Networks, Inc.
636 458 1462
<mailto:LarryCawley@AirgoNetworks.com> Tag: my first article Tag: 27741
Register NDIS driver to set device name
Hi
I have access to NDIS miniport driver code - I want to
communicate to it from a user app. I was attempting to
register the device using NDISMRegister Device so that I
could give it a device name and be able to access it. But
that crashes my system.
Can NDISMRegisterDevice be used with
NDISMRegisterMiniport without crashing the driver?
Can I retrieve device names without having to register
the device ?
I want to create a shared memory interface with the
driver using an IOCTL and am a novice to device driver
programming - hence the questions.
Thanks in advance
Brinda Tag: my first article Tag: 27732
CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD
I run into this error only under HCT (WHQL).
But the interesting point is that
1) I handle IRP_MN_REMOVE_DEVICE successfully.
2) When my Unload gets called, !drvobj shows
that the driver object owns no devices.
But even after my Unload routine exits, !drivers
shows that the module is still loaded.
What could keep a module from unloading after return
from driver unload?
regards,
m navab Tag: my first article Tag: 27728
How to differ the different network in protocol driver(802.3,802.11)
when i made the coding for the wireless lan in protocol
driver. i found, no matter how i improve my coding or not,
the information of medium i got is still 802.3, instead
of 802.11. i know this why. but i should base the medium
to use relative OID. So, who can tell me how to differ
these two netowrk (802.11,802.3)in protocol driver Tag: my first article Tag: 27726
IRQL_NOT_LESS_OR_EQUAL
Why could this code crash with "IRQL_NOT..."?
NTSTATUS USBBase::StartDataUrb(IN UCHAR data[4])
{
NTSTATUS status = STATUS_SUCCESS;
// Initialize the URB we use for writing the pipe
PURB urb = this->DataUrbMidi01;
USBD_PIPE_HANDLE Handle = this->MidiOut01;
ULONG urbflags = USBD_SHORT_TRANSFER_OK;
ULONG size = 4;
PUCHAR Data = data;
if (this->FirstStart) {
Data = ACTIVATION;
this->FirstStart = FALSE;
}
UsbBuildInterruptOrBulkTransferRequest(urb, sizeof
(_URB_BULK_OR_INTERRUPT_TRANSFER),
Handle, Data, NULL, size, urbflags, NULL);
PIRP Irp = this->DataIrpMidi01;
PIO_STACK_LOCATION stack =
IoGetNextIrpStackLocation(Irp);
stack->MajorFunction =
IRP_MJ_INTERNAL_DEVICE_CONTROL;
stack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
stack->Parameters.Others.Argument1 = (PVOID) urb;
Irp->Cancel = FALSE;
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
status = IoCallDriver(lowerDO, Irp);
!!! At this point!!!
return status;
}
Because of debug messages (code is deleted here) I know
the moment of system crash. It has to be somewhere in or
slightly after IoCallDriver(...). The routine is called
at passive level.
I'm thankfull for any suggestions. Tag: my first article Tag: 27723
How to write device installer?
Hi,
I'm in trouble. I have to write an installer for a modem, but have no
idea how to do that. I've tried to execute *.inf files from driver's
directory, but this didn't work.
Could you please advise me how to do that or point me to some tutorials?
Should I use some SetupDi methods?
Thanks,
K. Tag: my first article Tag: 27722
About NUmega KStreamSocket
HI:
Everyone,
A Problem about KStreamSocket make me very bored.
It is So:
When i create a socket via KStreamSocket.
and connect to peer is ok,then send is ok.
and receive is ok once,But once receive is finished.
unfortunately,the socket is disconnect automatically.
So, I have to connect it to peer again.
Why,What is problem?
Can you help me?
Jerry Tag: my first article Tag: 27713
TextOut
Hello ,
I have a strange problem which I have encountered in my code ,The DrvTextOut
Method of my driver fails when tested with speedy , on further debugging I
found out that it fails in the pcfallocatecachedFont method and at these
lines
// swap a cached font (using LRU method)
pFCNode = ppdev->pFC->pUsedList.pPrev;
//Change status into uncached
pFCNode->pfo->pvConsumer = NULL;
//clear glyph tag
pjFCTag = (PBYTE) pFCNode->pjTag;
for (i = 0; i < FC_MAX_GLYPH_ID; i += 4)
{
*(PULONG) pjFCTag = 0;
pjFCTag += 4;
} //for
Now the problems are as follows:
1.The driver doesn't break at the same position all the time sometimes it
breaks in the for loop some times just after the font is swapped .it also
doesn't break for a specific font id it just breaks randomly.
2.The same driver is working fine with speedy on a Pentium 4 machine with
256 mb ram whereas the orignal machine is intel celeron with 196 mb ram.
Now my doubts are :
1.Can this be because of the CPU speed , I think it might be a swapping
problem because it is giving me a page fault in non paged area.if it is how
can I make changes in the code to make it compatiable for the celeron
platform.
2.The replacement algorithm I have used is incorrect,I should not use LRU .
Please advise , as I am not clear if I am on right tracks.for further
refrece I am attaching the pcfAllocatecachedfont method.
Thanks & Regards,
Nitin Kapoor
PFCNODE pcfAllocateCachedFont(
PDEV* ppdev)
{
ULONG i;
PFCNODE pFCNode;
PBYTE pjFCTag;
pFCNode = ppdev->pFC->pFreeList;
if (pFCNode == NULL)
{
if (ppdev->pFC->pDiscardList != NULL)
{
ppdev->pFC->pFreeList = ppdev->pFC->pDiscardList;
ppdev->pFC->pDiscardList = NULL;
pFCNode = ppdev->pFC->pFreeList;
while (pFCNode)
{
//set the state into FC_FREE
pFCNode->iState = FC_FREE;
//clear glyph tag
pjFCTag = (PBYTE) pFCNode->pjTag;
for (i = 0; i < FC_MAX_GLYPH_ID; i += 4)
{
*(PULONG) pjFCTag = 0;
pjFCTag += 4;
} //for
pFCNode = pFCNode->pNext;
} //while
// wait engine idle
vWaitEngineIdle( ppdev );
// take the 1st free node
pFCNode = ppdev->pFC->pFreeList;
ppdev->pFC->pFreeList = pFCNode->pNext;
pFCNode->iState = FC_USED;
}
else
{
// swap a cached font (using LRU method)
pFCNode = ppdev->pFC->pUsedList.pPrev;
//Change status into uncached
pFCNode->pfo->pvConsumer = NULL;
//clear glyph tag
pjFCTag = (PBYTE) pFCNode->pjTag;
for (i = 0; i < FC_MAX_GLYPH_ID; i += 4)
{
*(PULONG) pjFCTag = 0;
pjFCTag += 4;
} //for
//delete from used list
vFCDeleteNode(pFCNode);
DISPDBG((0,"FONT CACHE AFTER DELETE NODE.\n",pFCNode->iUniq));
// wait engine idle
vWaitEngineIdle( ppdev );
DISPDBG((0,"FONT CACHE After WaitEngine Idle.\n",pFCNode->iUniq));
} //if-else
}
else
{
pFCNode->iState = FC_USED;
ppdev->pFC->pFreeList = pFCNode->pNext;
} //if
// keep double links for insert & delete
vFCInsertNode(&ppdev->pFC->pUsedList, pFCNode);
return(pFCNode);
} //pcfAllocateCachedFont( Tag: my first article Tag: 27710
why it doesnt work??????
i have got OID_802_11_STATISTICS's value and i can display
correctly, i put the follow function in the OnTimer event.
however, all of the value(transmitCount and receiveCount)
i got is zero.(my thought is to display the number of
transmit and received packages looks like the network
status)
void OnTimeer(XXXXX) {
IoctlNdisQueryTest(lpAdapterName)
}
DWORD IoctlNdisQueryTest(LPCTSTR lpAdapterName)
{
NDIS_802_11_STATISTICS OidData;
DWORD nResult, ReturnedCount = 0;
ZeroMemory( &OidData, sizeof(OidData));
OidData.Length = sizeof(OidData);
nResult = Test_IoctlNdisQueryGlobalStats
(lpAdapterName,OID_802_11_STATISTICS,OidData,sizeof
(OidData),&ReturnedCount);
if( nResult != ERROR_SUCCESS )
sprintf(sLabel,"%s","The driver unsupported");
else
sprintf(sLabel,"%I64d,%I64d",
OidData.TransmittedFragmentCount.QuadPart,
OidData.ReceivedFragmentCount.QuadPart); Tag: my first article Tag: 27708
kernel driver refuses to run in safe boot
I'm trying to write a very little SERVICE_KERNEL_DRIVER driver, which is
supposed to run during safe boot.
My current driver is as good as empty, I can successfully start & stop
it during a normal (non safe) session. Also it boots up in a normal (non
safe) session when being installed as SERVICE_SYSTEM_START. Everything
looks just fine.
But during safe boot XP suddenly is not able to load the driver. It
tries to load it (I've added it to the safe boot registry keys), but it
fails. The XP event log sais, XP was not able to load my driver, but it
doesn't tell me why.
If I check out the properties page of my driver (via device manager)
after a safe boot I can see that it is not running. If I then try to
manually start it, the dialog freezes for about 5 seconds, but the
driver still does not run.
What do I have to change to make my driver run successfully in a safe
boot?
Thanks!
P.S: I tried to add power, pnp and wmi handlers, but that didn't help,
either. Maybe I implemented them incorrectly, though.
============================================================
#include <ntddk.h>
void UnloadDriver(PDRIVER_OBJECT DriverObject)
{
IoDeleteDevice(DriverObject->DeviceObject);
}
NTSTATUS DummyIrpHandler(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING
RegistryPath)
{
PDEVICE_OBJECT devObj;
UNICODE_STRING name;
RtlInitUnicodeString(&name, L"\\Device\\MtsUpd");
IoCreateDevice(DriverObject, 4, &name, FILE_DEVICE_UNKNOWN, 0, FALSE,
&devObj);
DriverObject->DriverUnload = UnloadDriver;
DriverObject->MajorFunction[IRP_MJ_CREATE] = DummyIrpHandler;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = DummyIrpHandler;
return STATUS_SUCCESS;
} Tag: my first article Tag: 27707
scsi miniport HwStartIo() IRQL if no interrupts
in a scsi miniport driver for a virtual HW(obviously no HW
interrupts),
if i set the PORT_CONFIGURATION_INFORMATION -> BusInterruptVector = 0;
for findadapter
and
HW_INITIALIZATION_DATA -> HwScsiInterrupt = NULL
can i be gauranteed that my HwStartIo() and/or HwTimer()will be called
at DISPATCH_LEVEL(atleast)/PASSIVE_LEVEL? because i cant think of what
DIRQL can SCSIPORT assume before calling into me?
KeSynchronizeExecution() requires interrupt#
question 2
-------------
since HwStartIo() can be called at DIRQL what syncronization
mechanisms are available inside this routine to share data with a
PASSIVE_LEVEL thread? even spinlocks are useless > DISPATCH_LEVEL. i
am prepared to use any NTDDK only kernel functions
thx
alex Tag: my first article Tag: 27705
WinDDK Fails to Build Examples
I've installed the winddk 3790, read the release notes and
getting started guide, and attempted to build the examples
but I've had no luck-- the build is silently failing.
Executing 'build -cZ' from the command prompt spawned
by "Windows 2000 Checked Build Environment" rapidly
scrolls through all the example directories (much too fast
to be building) and exits without errors. If I look into
an example (i.e. src\general\portio) at the build log
file, I see entries like the following:
> Compiling c:\winddk\3790\src\general\portio\sys
directory *************
> 'nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1
NOPASS0=1 386=1'
> Bad command or file name
Any ideas? The log output is identical for every example
driver in the DDK. I'd expect building examples to "just
work" but I'm not familiar enough with this environment to
even begin to guess what is wrong. It should be mentioned
that I had this exact error mode using a previous Win2K
DDK, so I elected to grab the latest 2003 Server DDK in
the hopes that the integrated compiler, etc, would make
the effort easier. Tag: my first article Tag: 27702
About ClearCommError function
everyone:
Hi
I am writting a driver about a virtual device.
While application calls ClearCommError, The Driver must be able to reply a
response.
Now I dont know when driver receives the ioctl code,what is the SystemBuffer
of IRP?
and More, if app calls other API(WaitCommEvent,SetCommMask,etc.)
What is Their SystemBuffer?
Thank for your answer.
Jerry
1st.July.2003 Tag: my first article Tag: 27697
Get the long form of the specified path.
Hi
Is it possible to get the long path name of a specified path from the
short form of the path? In win32 there are functions named 'GetLongPathName'
or 'GetFullPathName' to achieve it, but what to to in a driver?
thanks
Yang Liu Tag: my first article Tag: 27693
PCMCIA card client driver samples?
I am starting write a 16 bit PC Card(Data Acquisition
card) driver for Windows
2000/XP and wondering if there is any code example. Can
anyone here point it out?
Thanks Tag: my first article Tag: 27686
ScatterGatherList Fails
Hi,
I am using GetScatterGatherList for doing Bus Master DMA.
It fails with status = "STATUS_BUFFER_TOO_SMALL". I have
called it 9 times, but only two times it passes.
What is the reason for this status code ? Which buffer is too small ?
Number of MapRegisters allocated is 8.
The buffer size to be transferred is 5120, it spans to a maximum of 3 pages.
The following is the function call
Status = DeviceExtension->AdapterObject->DmaOperations->GetScatterGatherList(
DeviceExtension->AdapterObject,
DeviceObject,
mdl, // IRP->MdlAddress
DeviceExtension->CurrentVaddr, // MmGetMdlVirtualAddress(mdl)
transferSize, // 8192 or 12298 (2 * PAGE_SIZE or 3 *PAGE_SIZE)
(PDRIVER_LIST_CONTROL) AdapterListControl,
DeviceExtension,
bOperationType); // bOperation = TRUE for a write, FALSE for a read.
Thanks
Kumar Tag: my first article Tag: 27685
Sample code for NDIS 802.11 driver?
Hi,
Is there any sample code for NDIS 802.11 driver?
I installed windows server 2003 DDK. There is no
802.11 driver sample.
Thanks for your input.
Lin Tag: my first article Tag: 27677
Paging file size problem for Win XP - Pro
I upgraded my machine from Win XP-Home to XP-Pro.
Everything is fine but the Virtual Memory problem -
everytime I boot the machine, it keeps giving me the "low
virtual memory" message. I have tried to use Start |
Settings | Control Panel | System|Advanced |...| Virtual
Memory Dialog to modify the Initial Size & Max Size
values, it seems that it doesn't work; the allocated
paging file size is always 0 even though I restart the
machine. Is there any other means to fix this?
thanx Tag: my first article Tag: 27671
[Q] USB Mass Storage Device IOCTL failure
I'm developing a USB mass storage device with an additional
functionality.
There is no problem in locating the device's symbolic link, using
SetupDiXXX functions. But if I try to DeviceIoControl()
IOCTL_STORAGE_GET_DEVICE_NUMBER, IOCTL_SCSI_GET_INQUIRY_DATA, and
other disk and storage control codes as well, after opening the device
through CreateFile() with the following symbolic link name, it fails
with the error code 50, which means ERROR_NOT_SUPPORTED.
\??\USB#Vid_0c76&Pid_0005#0304281630200#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
To be more precise, my USB storage device supports Bulk-Only Transport
protocol and announces itself as a SCSI transparent subclass device.
If there is anybody who had ever stuck in this type of problem, please
give me some clues for solving it.
****
I have one more question. I'm in the position to develop hardware and
software. So for now, I'm trying to compose a small program
controlling a mass storage device of another manufacturer. If I'm to
develop the firmware without relying on the USB controller customized
to the specific application, do I have to write a firmware parsing all
the SCSI command set? Or is there any documentation that specifies
which part of the standard SCSI command set USB mass storage device
spec supports? I'm afraid if I have to deal with a whole bunch of SCSI
command set. Need some advice.
Thanks Tag: my first article Tag: 27664
How to use "UsbBuildVendorRequest"?
Dear All,
I want to control USB hub. I found the command "UsbBuildVendorRequest"
may be work ,but I can't find some example which can teach me . Could
anybody tell me how to use that or where to find some example?
Thanks for your help
Randy Tag: my first article Tag: 27661
Problems sending named events to Driver
Hi NG
My driver has problems recieving a event from my user mode applikation. But
there is no problems recieving the same event in my appilication from the
device driver.
Thia is what I do:
In my DriverEntry i create the event with this:
// Create event for user-mode processes to monitor
RtlInitUnicodeString(&uszNotifyEventString,
L"\\BaseNamedObjects\\AppEvent");
// Trying to create the event
NotifyEvent = IoCreateNotificationEvent(&uszNotifyEventString,
&NotifyHandle);
if(NotifyEvent)
{
// Success
KdPrint(("NotifyEvent event created with success\r\n"));
// Clear it...
KeClearEvent(NotifyEvent);
}
I get the handle to the event in my application like this:
// Creating event. ITs created by the driver..
hEvent = OpenEvent(SYNCHRONIZE, FALSE, _T("AppEvent"));
if(NULL == hEvent )
{
return 0;
}
They both succed.
My application then waits for the event:
// The events used..
hEvents[0] = pService->HEndThread;
byNumOfEvents++;
hEvents[1] = hEvent ;
byNumOfEvents++;
dwWait = WaitForMultipleObjects(byNumOfEvents, hEvents, FALSE,
INFINITE);
if((WAIT_OBJECT_0 + 1) == dwWait)
{
// Set event again. Driver does not respond to this
SetEvent(hEvent ); <----- No responds in my driver on this
}
When my driver signals the event ( KeSetEvent(NotifyEvent, 0, TRUE) ) my
application is responding OK to the event
But when my application sets the event my driver does not respond to it.
// Setting event
KeSetEvent(NotifyEvent, 0, TRUE); <--- My application responds to this
KeResetEvent(NotifyEvent);
// Waiting for the service to answer
status = KeWaitForSingleObject(NotifyEvent, UserRequest, KernelMode,
FALSE, &WaitTimeOut);
// Never reached.
if(STATUS_SUCCESS == status)
{
KdPrint(("Got event.\r\n"));
// Service has answered. Clear the event. Shutdown in progress
KeResetEvent(NotifyEvent);
}
Any Idea ??
Schould I call the OpenEvent() with EVENT_ALL_ACCESS instead of SYNCHRONIZE
?? If I do I got an error that say "Access is denied". How can I create the
event with privilege to do this ??
Thomas Tag: my first article Tag: 27659
Error STATUS_NO_LOGON_SERVERS on HalAssignSlotResources
We've developed device driver for PCI device, which worked
fine on Windows 2000 and Windows XP. BUT after we
installed the latest SP4 for the Windows 2000, the call to
the HalAssignSlotResources returns error 0xC000005E ,
which is translated as STATUS_NO_LOGON_SERVERS.
What may be the reason of such behavior? Tag: my first article Tag: 27644
What does it mean?
when I build a console application, I saw the build
message in Pass 2:
Finished pass 1
Discarded "long __cdecl WRAPIEnumerateDevices(struct
WRAPI_NDIS_DEVICE * *,long *)" (?
WRAPIEnumerateDevices@@YAJPAPAUWRAPI_NDIS_DEVICE@@PAJ@Z)
from WRAPI.lib(WRAPI.dll)
Discarded "long __cdecl WRAPIOpenNdisDevice(unsigned
short *)" (?WRAPIOpenNdisDevice@@YAJPAG@Z) from WRAPI.lib
(WRAPI.dll)
Discarded "long __cdecl WRAPIGetSSId(unsigned char
*)" (?WRAPIGetSSId@@YAJPAE@Z) from WRAPI.lib(WRAPI.dll)
Discarded "long __cdecl WRAPISetSSId(unsigned char
*,unsigned long &)" (?WRAPISetSSId@@YAJPAEAAK@Z) from
WRAPI.lib(WRAPI.dll)
Discarded "long __cdecl WRAPIGetRTSThreshold(unsigned
long *)" (?WRAPIGetRTSThreshold@@YAJPAK@Z) from WRAPI.lib
(WRAPI.dll)
Discarded "long __cdecl WRAPIGetAssociatedAP(unsigned
char * const)" (?WRAPIGetAssociatedAP@@YAJQAE@Z) from
WRAPI.lib(WRAPI.dll)
Discarded "long __cdecl WRAPIGetPacketStats(struct
DOT_11_STATS *)" (?
WRAPIGetPacketStats@@YAJPAUDOT_11_STATS@@@Z) from
WRAPI.lib(WRAPI.dll)
Discarded "long __cdecl WRAPIGetAPList(struct AP_DATA
* *,long *)" (?WRAPIGetAPList@@YAJPAPAUAP_DATA@@PAJ@Z)
from WRAPI.lib(WRAPI.dll)
what does it mean?thank for response. Tag: my first article Tag: 27638
How to get the current link speed of wireless
i dont know how to get the current link speed in my
application using NDIS protocol DRIVER, but i know i
should use the function "oid_802_11_gen_link_speed".
However, i dont know how to use this function. who can
tell me this? i never find any sample i need. So, if
possible, who can post his/her parts of coding about it?
it's emergency! :< Tag: my first article Tag: 27630
meaning of INetCfgComponent::GetDeviceStatus()
What exactly is the "status of a network card" (DDK docs) returned by
INetCfgComponent::GetDeviceStatus() in 'pStatus'? The docs do not say
anything about how to interprete the value returned.
Stephan Tag: my first article Tag: 27626
WAVERR_BADFORMAT Error
I've got an app plays wav files in MULA format (7) using the standard API
calls (waveOutOpen, waveOutPrepareHeader, waveOutWrite, etc.). This app has
been running without problem on hundreds of machines and every operating
system Microsoft has put out from Windows 95 to Windows XP. Suddenly we've
got a client using NT 4 SP6 who's getting WAVERR_BADFORMAT errors returned
from waveOutOpen. When I call waveOutGetDevCaps on the device, it puts 4095
in the WAVEOUTCAPS.dwFormat field.
Anybody have any ideas what might cause this? Tag: my first article Tag: 27524