0

StartService gives me "error 2 The System Can't Find The File Specified"

I can't determine if my driver is messing up or if it's my user application. Here is what I am doing:

schService = CreateService(schSCManager, DriverName, DriverName, SERVICE_ALL_ACCESS | SERVICE_START | DELETE | SERVICE_STOP, SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_IGNORE, SYSTEM32_DRIVERS, NULL, NULL, NULL, NULL, NULL);
    if (schService == NULL)
    {
        printf("Error CreateService : %d\n", GetLastError());
    }
    schService = OpenService(schSCManager, DriverName, SERVICE_ALL_ACCESS);
    StartService(schService, 0, NULL);
adscfawsd
  • 1
  • 3
  • At what code line does the error occur? Maybe a dependent Dll isn't in the current directory and also not in the search path? Try using a dependency walker tool. – TToni May 24 '15 at 17:45
  • What's `SYSTEM32_DRIVERS`? – Igor Tandetnik May 24 '15 at 18:46
  • Its the location to my sys32 drivers and than my driver – adscfawsd May 24 '15 at 20:20
  • I think it has to do with my driver I will have a look and report back if it still says error 2. – adscfawsd May 24 '15 at 20:21
  • So now I got rid of error 2, but now comes up another one yay! The error is ERROR_INVALID_PARAMETER 87 (0x57) The parameter is incorrect. It is directed towards start service, I debugged it. – adscfawsd May 24 '15 at 20:50

0 Answers0