|
Look for a BSOD in the windows dir, or a minidump in the minidump dir. If its overheating the dump will tell.
Morality is indistinguishable from social proscription
|
|
|
|
|
Would a negative result be definitive there? Overclocking driven overheating can cause random bitrot in the core and I'd assume the same could happen even at standard specs, while I assume windows could only properly log a temperature warning (on die or on mobo sensor) related failure correctly.
You know, every time I tried to win a bar-bet about being able to count to 1000 using my fingers I always got punched out when I reached 4....
-- El Corazon
|
|
|
|
|
Hi there people,
I have problem running the following driver code. It worked for sometime
but without no obvious reason whenever I try to stop the driver service
a BSOD appears with the PAGE_FAULT_IN_NON_PAGED_AREA error.
I found out that when I remove the set DriverName code the problem disappears
but the question is why.
I'm desperate I cant find a way to fix this thing. I load the driver
with the instdrv.In the Debug Viewer only the HI message apperars Any ideas?
Here is the code
VOID UnLoadMe(IN PDRIVER_OBJECT obj);<br />
UNICODE_STRING us;<br />
<br />
NTSTATUS DriverEntry ( IN PDRIVER_OBJECT theDriverObject, IN PUNICODE_STRING theRegistryPath )<br />
{<br />
<br />
DbgPrint("HELLO");<br />
RtlInitUnicodeString( &us, L"TEST\0" );<br />
theDriverObject->DriverName=us;<br />
theDriverObject->DriverUnload=UnLoadMe;<br />
return STATUS_SUCCESS;<br />
}<br />
<br />
<br />
VOID UnLoadMe(IN PDRIVER_OBJECT obj)<br />
{<br />
DbgPrint("BYE");<br />
}
|
|
|
|
|
You shouldnt set the driver name, its given to you, its the name in the services key of your drivers entry. (Like 'serial', 'tcp', etc).
Morality is indistinguishable from social proscription
|
|
|
|
|
First, listen to fat-boy - he's correct!!
However, to help understand what is causing your problem ...
Given that error (which is very precise in telling you what the problem is), my guess is that your us variable is stored in a paged data area. You have to be careful with global variables in drivers that they are stored how you think they are stored. There may be a pragma in effect putting all code and data into paged-pool - this is quite common for initialization code.
Judy
|
|
|
|
|
Unless he didnt paste all his code in (ie he is using the PAGED pragma) then all driver code is memory resident, and global vars.
But, since DriverEntry runs at passive level you can access paged out code without any problem. This is probably one of those odd errors where the error used doesnt really reflect what went on. Probably, its read only memory, or the unicode string actually points to part of the registry file or some such.
Morality is indistinguishable from social proscription
|
|
|
|
|
fat_boy wrote: Unless he didnt paste all his code in (ie he is using the PAGED pragma)
That is what I was suspecting and was referring to when I talked about a pragma asociated with the initialization code. My guess on the crash is that after the OP changes the driver name to use that paged variable and DriverEntry returns, the page fault occurs as soon as the driver object is used somewhere not at Passive level since it references paged memory.
Judy
|
|
|
|
|
Yeah, a stack trace would show whether the bug is due to setting the name in the devo, or something else referencing the name, now in this drivers image.
I suspect its the former though.
Morality is indistinguishable from social proscription
|
|
|
|
|
By the way, when you get a crash like this, then you can look at the memory dump in WinDbg. The crash dump will either be called memory.dmp in the windows dir or it'll be in the minidump dir dependig on how your machine is set up.
The best way to fix bugs though is kernel debuging. Take alook in the DDK for how to do this. (Null modem cable, modify boot.ini, and use windbg)
Morality is indistinguishable from social proscription
|
|
|
|
|
I have several USB drives, as I would guess most people do. Recently I have found that when I plug it in, windows explorer will not find it and show it in the list of available drives. I have tried the microsoft recommendation (a registry hack), and have made sure the disk manager is looking to place in in the right drive letter (and the driver is not occupied), I have tried, as I found suggested in one place, rebooting with the drive in place, it shows up then but if I remove it and plug it back in nada.
A friend at work has the same problem, he seems to have gotten lucky and has one that works (between us we have a dozen or so, different brands)
Open a DOS windows, go to the F: drive and there it is. Open Total commander or something liek that it shows up. It even shows up if I try to do a File -> save as, it just will not show up in explorer... and yes I did google it.
This just started happening recently (XP SP2 with a company that is anal about pushing service packs out as son as they are released)
Any ideas?
Thanks
|
|
|
|
|
Hi,
I want to communicate with a USB device from my PC by using Visual C++.The device is a RF-ID.So I do not need to transfer large files, I only need to read the ID from RF-ID. How can I do that simply? I search the web some but the sources that I found are more advanced than I can understand. Can you seggest me a simple way because I am not much experienced?
Thanks for any help
ibrahim
|
|
|
|
|
If you didn't receive any documentation with the device (which is highly doubt), you should contact the supplier of the device because the way to communicate with the device driver is in general specific to the device (so, in other words, we can't help without having much more information).
|
|
|
|
|
The problem is that I don't know how to communicate with the driver by using programmming languages. For example I am using Visual C++.What is the code for the communication?I have not the documentation but I will get it.
Thanks
|
|
|
|
|
To get a handle to the driver you call CreateFile passing the driver symbolic name (which depends on the device), then you can call ReadFile and WriteFile (if they are implemented by the driver). For more advanced stuff, you can call DeviceIOControl and pass device specific control codes.
So, I repeat myself once again (I think you alread asked questions about it yesterday too): we can't help you with more because the codes and the driver symbolic name depends on how they implemented their driver. So, you should have received some documentation with the device. Did you read it before asking questions here ? If you didn't receive documentation, you should contact the supplier of the device.
|
|
|
|
|
What sort of device is it, and what does it support in the way of IOCTLs? The manufacturer wil know this.
To talk to it, as Cedric says, you use CreateFile() DeviceIOControl() etc.
Morality is indistinguishable from social proscription
|
|
|
|
|
I have to simulate a device as EPSONSTYLUS 7300 including printer and mass storage.
after created a device with 2 interface one for printer and for USB.
I plug it to my PC, and windows can detect it immediately.
Then is my created device (On Computer management)
Composite device
USB#VID_04B8&PID_0838#061010702081629190
one is Printer Device
USB#VID_04B8&PID_0838#MI_01&ED020F5&0&0001
second is USB device
USB#VID_04B8&PID_0838#MI_02&ED020F5&0&0002
But infact i must create a device with can be compatible with Epson printer device as
USBPRINT\EPSONSTYLUS_CX7300\7&C3F6D19&0&USB001
although i set up my configurations as
http://www.usb.org/developers/devclass_docs/usbprint11.pdf
How Can i configure it in my code
Thanks a lot.
xuanthinh
|
|
|
|
|
Hi,
Can you use Device Driver type API's such as KeRaiseIrql in application code .exe DLL or dos it have to be in a .sys device driver
|
|
|
|
|
I cannot imagine why you would want modify IRQ priorities from usermode. You cannot use this function in a usermode application.
Best Wishes,
-David Delaune
|
|
|
|
|
I wanted to control block lookup in my DLL ETHREAD etc.... can I do that in .exe/DLL or is that restricted to .sys Device Driver files
|
|
|
|
|
can I do SetKmode if I want to look at lets ETHREAD of a Thread the TEB in exe/DLL
|
|
|
|
|
Correct. You cant use it in user mode code.
Some kernel funcitons do map to user mode (CreateFile() maps to ZwCreateFile() for example) but, you still canot call them directly.
Same for Kernel mode, you cant call the Win32 API.
The ONLY way to cross the line from Kernel to User modes (the IO manager) is via CreateFile(), ReadFile() WriteFile() and DeviceIOControl().
Memory too is seperate. Kernel mode is the top 2 gig on a 32 bit processor, user mode is the bottom 2 gig.
You can under certain circumstances acess user mode memory from kernel mode (in IOP handler routines since the process is mapped in at that point) and there are tricks for sharing events (quite usefull).
Bu, to aid clarity, think of user and kernel modes as totally seperate.
Morality is indistinguishable from social proscription
|
|
|
|
|
Then my next question is the SetKmode is only for Windwos CE not XP correct
|
|
|
|
|
ForNow wrote: only for Windwos CE not XP correct?
Yes
|
|
|
|
|
I know you you are the one who told me this thankx
How about I start a Kernel mode thread PsThreadCreate... maybe to do my Kernel mode work
whitout wasting your time is there anyway I can do Kernel mode type work in user mode
or should I forgot this
|
|
|
|
|
ForNow wrote: How about I start a Kernel mode thread PsThreadCreate... maybe to do my Kernel mode work
PsCreateSystemThread can only be called from kernel mode so it won't help you in user mode.
ForNow wrote: whitout wasting your time is there anyway I can do Kernel mode type work in user mode
No you can't. That's why one is called kernel and one is called user - they are very distinct and only communicate through a few well-defined interfaces.
Judy
|
|
|
|