W2K build using 2003 DDK is different to a build using 2000 DDK

I currently have a project that is built using the W2K DDK (not sure of
version) and this allows me to use net stop/start.

If the same code is built using the 2003 DDK SP1 (3790.1830) &
hollistech ddkbuild, using the switch -WNETW2K the driver can be started
with ‘net start’ but when issuing ‘net stop’ it responds with “The
requested pause or stop is not valid for this servce.”. The same also
happens for an AMD64 build using the switch -WNETA64. Is there anyway
to correct this?

Using SC QUERY (either W2K or XP64) at the command line shows its a
kernel driver, stoppable, not_pausable, ignores_shutdown.

DriverEntry code (some lines omitted)

status = IoCreateDevice( DriverObject,
sizeof(LOCAL_DEVICE_INFO),
&uniNtNameString,
FILE_DEVICE_UNKNOWN,
0,
FALSE,
&DeviceObject );

pLocalInfo = (PLOCAL_DEVICE_INFO)DeviceObje-ct->DeviceExtension;

pLocalInfo->DeviceObject = DeviceObject;
pLocalInfo->DeviceType = FILE_DEVICE_UNKNOWN;

DriverObject->MajorFunction[IR-P_MJ_CREATE] = DK2DRVOpen;
DriverObject->MajorFunction[IR-P_MJ_CLOSE] = DK2DRVClose;
DriverObject->MajorFunction[IR-P_MJ_DEVICE_CONTROL] =
DK2DRVDispatch;
DriverObject->DriverUnload = DK2DRVUnload; //This never gets
called

TIA DarlyB

Hello Daryl,

I currently have a project that is built using the W2K DDK (not sure of
version) and this allows me to use net stop/start.

If the same code is built using the 2003 DDK SP1 (3790.1830) &
hollistech ddkbuild, using the switch -WNETW2K the driver can be started
with ‘net start’ but when issuing ‘net stop’ it responds with “The
requested pause or stop is not valid for this servce.”. The same also
happens for an AMD64 build using the switch -WNETA64. Is there anyway
to correct this?

I used a test driver built with the w2k checked build env w2k3 ddk sp1
(3790.1830).
The driver loads/unloads ok. So, it’s not the ddk…

Using SC QUERY (either W2K or XP64) at the command line shows its a
kernel driver, stoppable, not_pausable, ignores_shutdown.

DriverEntry code (some lines omitted)

status = IoCreateDevice( DriverObject,
sizeof(LOCAL_DEVICE_INFO),
&uniNtNameString,
FILE_DEVICE_UNKNOWN,
0,
FALSE,
&DeviceObject );

pLocalInfo = (PLOCAL_DEVICE_INFO)DeviceObje-ct->DeviceExtension;

pLocalInfo->DeviceObject = DeviceObject;
pLocalInfo->DeviceType = FILE_DEVICE_UNKNOWN;

DriverObject->MajorFunction[IR-P_MJ_CREATE] = DK2DRVOpen;
DriverObject->MajorFunction[IR-P_MJ_CLOSE] = DK2DRVClose;
DriverObject->MajorFunction[IR-P_MJ_DEVICE_CONTROL] =
DK2DRVDispatch;
DriverObject->DriverUnload = DK2DRVUnload; //This never gets
called

TIA DarlyB


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Ignorance more frequently begets confidence than does knowledge.
— Charles Darwin


This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/

Which sample did you build?

I also used another machine with only 2003 DDK installed and it still
exhibits the same problem.

I used a test driver built with the w2k checked build env w2k3 ddk sp1
(3790.1830).
The driver loads/unloads ok. So, it’s not the ddk…

Daryl Baker wrote:

Which sample did you build?

I wrote a small driver, just a skeleton that I use for tests. It’s very
simple and supports unload.
It also creates a device object that can be opened from user mode.

I also used another machine with only 2003 DDK installed and it still
exhibits the same problem.

The driver would not unload if there are open handles to any of it’s
device objects.
I’m not sure what error code is returned in that case.

>I used a test driver built with the w2k checked build env w2k3 ddk sp1
>
>
(3790.1830).

>The driver loads/unloads ok. So, it’s not the ddk…
>
>


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Ignorance more frequently begets confidence than does knowledge.
— Charles Darwin


This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/

Andrei Zlate-Podani wrote:

>
The driver would not unload if there are open handles to any of it’s
device objects.
I’m not sure what error code is returned in that case.

Of course not. Does this surprise you?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Actually, I am pretty sure an NT4 style driver’s Unload routine will be
called if there are open handles. After calling IoDeleteDevice, all
subsequent i/o will be failed by the i/o manager.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Thursday, May 19, 2005 8:45 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] W2K build using 2003 DDK is different to a build
using 2000 DDK

Andrei Zlate-Podani wrote:

>
The driver would not unload if there are open handles to any of it’s
device objects.
I’m not sure what error code is returned in that case.

Of course not. Does this surprise you?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Tim Roberts wrote:

Andrei Zlate-Podani wrote:

>>
> The driver would not unload if there are open handles to any of it’s
> device objects.
> I’m not sure what error code is returned in that case.
>

Of course not. Does this surprise you?

The OP had a problem, so I just point out things that may be wrong.
If you know the answer to the question, please share with us. Otherwise,
I would appreciate if you kept your remarks to yourself.

Andrei


Ignorance more frequently begets confidence than does knowledge.
— Charles Darwin


This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/

Andrei Zlate-Podani wrote:

Tim Roberts wrote:

> Andrei Zlate-Podani wrote:
>
>>>
>> The driver would not unload if there are open handles to any of it’s
>> device objects.
>> I’m not sure what error code is returned in that case.
>>
>
> Of course not. Does this surprise you?
>
The OP had a problem, so I just point out things that may be wrong.
If you know the answer to the question, please share with us. Otherwise,
I would appreciate if you kept your remarks to yourself.

Sorry, I thought you were the OP. I didn’t read carefully enough.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.