Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

driver service cannot be stopped

GUGU Member - All Emails Posts: 8
When I try to stop the driver service by "sc stop", I got below error message.
===========
C:\Temp>sc stop StorTrace
[SC] ControlService FAILED 1052:

The requested control is not valid for this service.
===========



I have already specified the driver_unload function in the DriverEntry() as in below code. And I confirmed from the Dbg log that DriverUnload function is not get called when "sc stop" is issued.

https://github.com/noguxun/StorTrace/blob/master/StorTrace/Driver.c
==========
// config.DriverInitFlags = WdfDriverInitNonPnpDriver;
config.EvtDriverUnload = DriverUnload;

status = WdfDriverCreate(DriverObject,
RegistryPath,
&attributes,
&config,
WDF_NO_HANDLE
);
==========

The driver service is created by below, with
=========
sc create StorTrace binPath= %SystemRoot%\System32\Drivers\StorTrace.sys type= kernel start= demand
=========


Here is the service query information
=========
C:\Temp>sc query StorTrace

SERVICE_NAME: StorTrace
TYPE : 1 KERNEL_DRIVER
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
=========

Does anyone know what could be the reason the driver could not be stopped?

Comments

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 6,990
    You can neither start nor stop PnP filters with the Service Control Manager. You need to use an INF and Device Manager (or devcon).

    Peter
    OSR
    @OSRDrivers

    Peter Viscarola
    OSR
    @OSRDrivers

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 25 Feb 2019 OSR Seminar Space
Developing Minifilters 8 April 2019 OSR Seminar Space