From: Naveen Kohli [Nkohli@pumatech.com] Sent: Thursday, March 29, 2001 4:33 PM To: NT Developers Interest List Subject: [ntdev] Re: StartService API failing with Error 2 Here is the implementation of my simple DriverEntry routine.. I guess I have implemented it correctly.. NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { KdPrint (("KSQuery - " "Entering DriverEntry : DriverObject %8.8lX\n", DriverObject)); NTSTATUS ntStatus = STATUS_SUCCESS; PDEVICE_OBJECT pDeviceObject = NULL; UNICODE_STRING ustrDrvName; UNICODE_STRING ustrDvcName; // Initialize the counted unicode string and // Set the driver name. RtlInitUnicodeString (&ustrDrvName, L"\\Device\\KSKeDrv"); // Create the device object and make sure that call succeeds. Otherwise // return the error code. ntStatus = IoCreateDevice (DriverObject,0,&ustrDrvName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject); if (STATUS_SUCCESS != ntStatus) { return ntStatus; } // Initialize and set the device name. RtlInitUnicodeString (&ustrDvcName, L"\\DosDevices\\KSKeDrv"); // Create the symbolic link to the user-visible name. ntStatus = IoCreateSymbolicLink (&ustrDvcName, // User visible name &ustrDrvName // Name created by driver ); if (STATUS_SUCCESS != ntStatus) { // Make sure to delete the created device. IoDeleteDevice (pDeviceObject); return ntStatus; } // Set the various entry point functions for various // message handling. DriverObject->DriverUnload = KSDriverUnload; // Add the IRP_MJ_xxx request function... DriverObject->MajorFunction[IRP_MJ_CREATE] = KSDriverCreate; DriverObject->MajorFunction[IRP_MJ_CLOSE] = KSDriverClose; DriverObject->MajorFunction[IRP_MJ_CLEANUP] = KSDriverCleanUp; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = KSDriverDeviceControl; return STATUS_SUCCESS; } Naveen -----Original Message----- From: Gregory G. Dyess [mailto:dyessg1@pdq.net] Sent: Thursday, March 29, 2001 3:35 PM To: NT Developers Interest List Subject: [ntdev] Re: StartService API failing with Error 2 Shouldn't the ImagePath be a string instead of hex? Greg > -----Original Message----- > From: bounce-ntdev-395@lists.osr.com > [mailto:bounce-ntdev-395@lists.osr.com]On Behalf Of Naveen Kohli > Sent: Thursday, March 29, 2001 2:12 PM > To: NT Developers Interest List > Subject: [ntdev] Re: StartService API failing with Error 2 > > > Hi Michal, > Here is the dump of registry node for KsKeDrv. Let me know if it gives > any cluse. One thing I noticeis that INITSTRATFAILED value is set to > 1. doe this mean that some entry point in driver failed? > > Thanks! > Naveen > > Windows Registry Editor Version 5.00 > > [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KSKeDrv] > "DisplayName"="KSKeDrv" > "ErrorControl"=dword:00000001 > "ImagePath"=hex(2):4b,00,53,00,4b,00,45,00,44,00,52,00,56,00,2e,00 > ,53,00,59, > 00,\ > 53,00,00,00 > "Start"=dword:00000003 > "Type"=dword:00000001 > > [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KSKeDrv\Security > ] > "Security"=hex:01,00,14,80,a0,00,00,00,ac,00,00,00,14,00,00,00,30, > 00,00,00,0 > 2,\ > > 00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00, > 01,00,00,\ > > 00,00,02,00,70,00,04,00,00,00,00,00,18,00,fd,01,02,00,01,01,00,00, > 00,00,00,\ > > 05,12,00,00,00,00,00,00,00,00,00,1c,00,ff,01,0f,00,01,02,00,00,00, > 00,00,05,\ > > 20,00,00,00,20,02,00,00,64,02,00,00,00,00,18,00,8d,01,02,00,01,01, > 00,00,00,\ > > 00,00,05,0b,00,00,00,20,02,00,00,00,00,1c,00,fd,01,02,00,01,02,00, > 00,00,00,\ > > 00,05,20,00,00,00,23,02,00,00,64,02,00,00,01,01,00,00,00,00,00,05, > 12,00,00,\ > 00,01,01,00,00,00,00,00,05,12,00,00,00 > > [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KSKeDrv\Enum] > "Count"=dword:00000000 > "INITSTARTFAILED"=dword:00000001 "NextInstance"=dword:00000000 > > -----Original Message----- > From: Vodicka, Michal [mailto:mvodicka@rkk.cz] > Sent: Thursday, March 29, 2001 2:27 PM > To: NT Developers Interest List > Subject: [ntdev] Re: StartService API failing with Error 2 > > > OK, start regedt32, go to > HKLM\System\CurrentControlSet\Services\KsKeDrv and examine ImagePath > value. Also try sc start KsKeDrv. > > Best regards, > > Michal Vodicka > Veridicom > (RKK - Skytale) > [WWW: http://www.veridicom.com , http://www.skytale.com] > > > > > ---------- > > From: nkohli@pumatech.com[SMTP:nkohli@pumatech.com] > > Reply To: NT Developers Interest List > > Sent: Thursday, March 29, 2001 3:00 AM > > To: NT Developers Interest List > > Subject: [ntdev] Re: StartService API failing with Error 2 > > > > Here is some more information... > > -I am trying this on Win2K Prof Release Build system > > -Just making sure that if copying SYS file to WinNt/System32/Drivers > > folder make any difference, i copied the file to both locations too. > > > > I ran the following query on my system.. > > > > >sc query KsKeDrv > > > > Here is the result.. > > > > SERVICE_NAME: KsKeDrv > > Type :1 KERNEL_DRIVER > > STATE:1 STOPPED > > (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN) > > WIN32_EXIT_CODE: 1077 > > SERVICE_EXIT_CODE: 0 (0x0) > > CHECKPOINT: 0x0 > > WAIT_HINT: 0x0 > > > > Still i have the same problem.. > > > > --- > You are currently subscribed to ntdev as: nkohli@pumatech.com To > unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com > > --- > You are currently subscribed to ntdev as: dyessg1@pdq.net > To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com --- You are currently subscribed to ntdev as: nkohli@pumatech.com To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com --- You are currently subscribed to ntdev as: GlennEverhart@FirstUSA.com To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com