Lots of DPRINT1 -> DPRINT changes

Adjust the image path in ScmrCreateServiceW (just enough for my needs)

svn path=/trunk/; revision=19037
This commit is contained in:
Hervé Poussineau 2005-11-07 10:53:52 +00:00
parent 301aa7523d
commit aa57b3e940

View file

@ -281,7 +281,7 @@ ScmrControlService(handle_t BindingHandle,
PSERVICE_HANDLE hSvc; PSERVICE_HANDLE hSvc;
PSERVICE lpService; PSERVICE lpService;
DPRINT1("ScmrControlService() called\n"); DPRINT("ScmrControlService() called\n");
if (ScmShutdown) if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS; return ERROR_SHUTDOWN_IN_PROGRESS;
@ -326,7 +326,7 @@ ScmrDeleteService(handle_t BindingHandle,
PSERVICE lpService; PSERVICE lpService;
DWORD dwError; DWORD dwError;
DPRINT1("ScmrDeleteService() called\n"); DPRINT("ScmrDeleteService() called\n");
if (ScmShutdown) if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS; return ERROR_SHUTDOWN_IN_PROGRESS;
@ -361,7 +361,7 @@ ScmrDeleteService(handle_t BindingHandle,
/* FIXME: Release service database lock */ /* FIXME: Release service database lock */
DPRINT1("ScmrDeleteService() done\n"); DPRINT("ScmrDeleteService() done\n");
return dwError; return dwError;
} }
@ -509,13 +509,13 @@ ScmrChangeServiceConfigW(handle_t BiningHandle,
PSERVICE_HANDLE hSvc; PSERVICE_HANDLE hSvc;
PSERVICE lpService = NULL; PSERVICE lpService = NULL;
DPRINT1("ScmrChangeServiceConfigW() called\n"); DPRINT("ScmrChangeServiceConfigW() called\n");
DPRINT1("dwServiceType = %lu\n", dwServiceType); DPRINT("dwServiceType = %lu\n", dwServiceType);
DPRINT1("dwStartType = %lu\n", dwStartType); DPRINT("dwStartType = %lu\n", dwStartType);
DPRINT1("dwErrorControl = %lu\n", dwErrorControl); DPRINT("dwErrorControl = %lu\n", dwErrorControl);
DPRINT1("lpBinaryPathName = %S\n", lpBinaryPathName); DPRINT("lpBinaryPathName = %S\n", lpBinaryPathName);
DPRINT1("lpLoadOrderGroup = %S\n", lpLoadOrderGroup); DPRINT("lpLoadOrderGroup = %S\n", lpLoadOrderGroup);
DPRINT1("lpDisplayName = %S\n", lpDisplayName); DPRINT("lpDisplayName = %S\n", lpDisplayName);
if (ScmShutdown) if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS; return ERROR_SHUTDOWN_IN_PROGRESS;
@ -554,7 +554,7 @@ ScmrChangeServiceConfigW(handle_t BiningHandle,
/* FIXME: Unlock database */ /* FIXME: Unlock database */
DPRINT1("ScmrChangeServiceConfigW() done (Error %lu)\n", dwError); DPRINT("ScmrChangeServiceConfigW() done (Error %lu)\n", dwError);
return dwError; return dwError;
} }
@ -587,15 +587,15 @@ ScmrCreateServiceW(handle_t BindingHandle,
LPWSTR lpImagePath = NULL; LPWSTR lpImagePath = NULL;
HKEY hServiceKey = NULL; HKEY hServiceKey = NULL;
DPRINT1("ScmrCreateServiceW() called\n"); DPRINT("ScmrCreateServiceW() called\n");
DPRINT1("lpServiceName = %S\n", lpServiceName); DPRINT("lpServiceName = %S\n", lpServiceName);
DPRINT1("lpDisplayName = %S\n", lpDisplayName); DPRINT("lpDisplayName = %S\n", lpDisplayName);
DPRINT1("dwDesiredAccess = %lx\n", dwDesiredAccess); DPRINT("dwDesiredAccess = %lx\n", dwDesiredAccess);
DPRINT1("dwServiceType = %lu\n", dwServiceType); DPRINT("dwServiceType = %lu\n", dwServiceType);
DPRINT1("dwStartType = %lu\n", dwStartType); DPRINT("dwStartType = %lu\n", dwStartType);
DPRINT1("dwErrorControl = %lu\n", dwErrorControl); DPRINT("dwErrorControl = %lu\n", dwErrorControl);
DPRINT1("lpBinaryPathName = %S\n", lpBinaryPathName); DPRINT("lpBinaryPathName = %S\n", lpBinaryPathName);
DPRINT1("lpLoadOrderGroup = %S\n", lpLoadOrderGroup); DPRINT("lpLoadOrderGroup = %S\n", lpLoadOrderGroup);
if (ScmShutdown) if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS; return ERROR_SHUTDOWN_IN_PROGRESS;
@ -622,7 +622,11 @@ ScmrCreateServiceW(handle_t BindingHandle,
if (dwServiceType & SERVICE_DRIVER) if (dwServiceType & SERVICE_DRIVER)
{ {
/* FIXME: Adjust the image path */ /* FIXME: Adjust the image path
* Following line is VERY BAD, because it assumes that the
* first part of full file name is the OS directory */
if (lpBinaryPathName[1] == ':') lpBinaryPathName += GetWindowsDirectoryW(NULL, 0);
lpImagePath = HeapAlloc(GetProcessHeap(), lpImagePath = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, HEAP_ZERO_MEMORY,
(wcslen(lpBinaryPathName) + 1) * sizeof(WCHAR)); (wcslen(lpBinaryPathName) + 1) * sizeof(WCHAR));
@ -787,7 +791,7 @@ done:;
if (dwError == ERROR_SUCCESS) if (dwError == ERROR_SUCCESS)
{ {
DPRINT1("hService %lx\n", hServiceHandle); DPRINT("hService %lx\n", hServiceHandle);
*hService = (unsigned int)hServiceHandle; *hService = (unsigned int)hServiceHandle;
if (lpdwTagId != NULL) if (lpdwTagId != NULL)
@ -814,7 +818,7 @@ done:;
if (lpImagePath != NULL) if (lpImagePath != NULL)
HeapFree(GetProcessHeap(), 0, lpImagePath); HeapFree(GetProcessHeap(), 0, lpImagePath);
DPRINT1("ScmrCreateServiceW() done (Error %lu)\n", dwError); DPRINT("ScmrCreateServiceW() done (Error %lu)\n", dwError);
return dwError; return dwError;
} }
@ -903,7 +907,7 @@ ScmrOpenServiceW(handle_t BindingHandle,
lpService = ScmGetServiceEntryByName(lpServiceName); lpService = ScmGetServiceEntryByName(lpServiceName);
if (lpService == NULL) if (lpService == NULL)
{ {
DPRINT1("Could not find a service!\n"); DPRINT("Could not find a service!\n");
return ERROR_SERVICE_DOES_NOT_EXIST; return ERROR_SERVICE_DOES_NOT_EXIST;
} }