MajorFunction IRP_MJ_POWER does not get called

Posted: 09-01-2004, 02:26 PM
Hi

I do have a MajorFunction[IRP_MJ_POWER] function in my driver. But it seems
not to get called when i restarting the system. (Start->shutdown->restart)
Schouldn't the function when the restart is issued. ?
I have tried to do a systemlog entry, when the functions gets called, but
the log entry never show up.

From my DriverEntry:

DriverObject->MajorFunction[IRP_MJ_CREATE] = DrvOpen;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = DrvClose;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DrvDeviceControl;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = DrvCleanup;
DriverObject->MajorFunction[IRP_MJ_POWER] = DrvPower;

All the other major functions gets called..

From the DrvPower function:

NTSTATUS UPSPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
POWER_STATE_TYPE powerType;
POWER_STATE powerState;
PIO_STACK_LOCATION pIrpStack;
NTSTATUS status;

// Get the Itp
pIrpStack = IoGetCurrentIrpStackLocation(Irp);

// Get the power type and state
powerType = pIrpStack->Parameters.Power.Type;
powerState = pIrpStack->Parameters.Power.State;

// Write to log. Just for test
DrvErrorLog(ERRLOG_DEVICE_POWER, DeviceObject, L"DrvPower function
called"); // This never get in system log.

............
...........

}

The DrvErrorLog does work and verified
So is the system log closed, before the IRP_MJ_POWER function is called ?
Does it never gets called with windows restart ?
I just whant my driver to know if windows are shutting down og restarting..

Thomas


Reply With Quote

Responses to "MajorFunction IRP_MJ_POWER does not get called"

 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
what are those big windows in castles called? Guest Windows NT/2000/XP 0 03-15-2008 06:08 PM
Setting up New Group called Remote Control Operators Paul Tyler Windows XP Embedded 7 11-12-2003 09:31 PM
BindAdapterHandler for WDM/ NDIS protocol driver not called QuasiCodo Windows XP Device Drivers 2 09-22-2003 10:18 PM


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90