[SERVICES]
[reactos.git] / reactos / dll / win32 / advapi32 / service / scm.c
index 28823aa..64fa02c 100644 (file)
@@ -229,11 +229,11 @@ ChangeServiceConfig2W(SC_HANDLE hService,
     switch (dwInfoLevel)
     {
         case SERVICE_CONFIG_DESCRIPTION:
-            Info.psd = (LPSERVICE_DESCRIPTIONW)&lpInfo;
+            Info.psd = (LPSERVICE_DESCRIPTIONW)lpInfo;
             break;
 
         case SERVICE_CONFIG_FAILURE_ACTIONS:
-            Info.psfa = (LPSERVICE_FAILURE_ACTIONSW)&lpInfo;
+            Info.psfa = (LPSERVICE_FAILURE_ACTIONSW)lpInfo;
             break;
 
         default:
@@ -288,14 +288,14 @@ ChangeServiceConfigA(SC_HANDLE hService,
     DWORD dwError;
     DWORD dwDependenciesLength = 0;
     DWORD dwLength;
-    LPSTR lpStr;
+    LPCSTR lpStr;
 
     TRACE("ChangeServiceConfigA() called\n");
 
     /* Calculate the Dependencies length*/
     if (lpDependencies != NULL)
     {
-        lpStr = (LPSTR)lpDependencies;
+        lpStr = lpDependencies;
         while (*lpStr)
         {
             dwLength = strlen(lpStr) + 1;
@@ -362,14 +362,14 @@ ChangeServiceConfigW(SC_HANDLE hService,
     DWORD dwError;
     DWORD dwDependenciesLength = 0;
     DWORD dwLength;
-    LPWSTR lpStr;
+    LPCWSTR lpStr;
 
     TRACE("ChangeServiceConfigW() called\n");
 
     /* Calculate the Dependencies length*/
     if (lpDependencies != NULL)
     {
-        lpStr = (LPWSTR)lpDependencies;
+        lpStr = lpDependencies;
         while (*lpStr)
         {
             dwLength = wcslen(lpStr) + 1;
@@ -540,10 +540,10 @@ CreateServiceA(SC_HANDLE hSCManager,
     DWORD dwDependenciesLength = 0;
     DWORD dwError;
     DWORD dwLength;
-    LPSTR lpStr;
+    LPCSTR lpStr;
 
     TRACE("CreateServiceA() called\n");
-    TRACE("%p %s %s\n", hSCManager, 
+    TRACE("%p %s %s\n", hSCManager,
           lpServiceName, lpDisplayName);
 
     if (!hSCManager)
@@ -552,10 +552,10 @@ CreateServiceA(SC_HANDLE hSCManager,
         return NULL;
     }
 
-    /* Calculate the Dependencies length*/
+    /* Calculate the Dependencies length */
     if (lpDependencies != NULL)
     {
-        lpStr = (LPSTR)lpDependencies;
+        lpStr = lpDependencies;
         while (*lpStr)
         {
             dwLength = strlen(lpStr) + 1;
@@ -628,10 +628,10 @@ CreateServiceW(SC_HANDLE hSCManager,
     DWORD dwDependenciesLength = 0;
     DWORD dwError;
     DWORD dwLength;
-    LPWSTR lpStr;
+    LPCWSTR lpStr;
 
     TRACE("CreateServiceW() called\n");
-    TRACE("%p %S %S\n", hSCManager, 
+    TRACE("%p %S %S\n", hSCManager,
           lpServiceName, lpDisplayName);
 
     if (!hSCManager)
@@ -640,10 +640,10 @@ CreateServiceW(SC_HANDLE hSCManager,
         return NULL;
     }
 
-    /* Calculate the Dependencies length*/
+    /* Calculate the Dependencies length */
     if (lpDependencies != NULL)
     {
-        lpStr = (LPWSTR)lpDependencies;
+        lpStr = lpDependencies;
         while (*lpStr)
         {
             dwLength = wcslen(lpStr) + 1;
@@ -2152,7 +2152,7 @@ QueryServiceConfig2A(SC_HANDLE hService,
 
                 if (lpPtr->lpDescription != NULL)
                     lpPtr->lpDescription =
-                        (LPSTR)((UINT_PTR)lpPtr + (UINT_PTR)lpPtr->lpDescription);
+                        (LPSTR)((ULONG_PTR)lpPtr + (ULONG_PTR)lpPtr->lpDescription);
             }
             break;
 
@@ -2162,15 +2162,15 @@ QueryServiceConfig2A(SC_HANDLE hService,
 
                 if (lpPtr->lpRebootMsg != NULL)
                     lpPtr->lpRebootMsg =
-                        (LPSTR)((UINT_PTR)lpPtr + (UINT_PTR)lpPtr->lpRebootMsg);
+                        (LPSTR)((ULONG_PTR)lpPtr + (ULONG_PTR)lpPtr->lpRebootMsg);
 
                 if (lpPtr->lpCommand != NULL)
                     lpPtr->lpCommand =
-                        (LPSTR)((UINT_PTR)lpPtr + (UINT_PTR)lpPtr->lpCommand);
+                        (LPSTR)((ULONG_PTR)lpPtr + (ULONG_PTR)lpPtr->lpCommand);
 
                 if (lpPtr->lpsaActions != NULL)
                     lpPtr->lpsaActions =
-                        (SC_ACTION*)((UINT_PTR)lpPtr + (UINT_PTR)lpPtr->lpsaActions);
+                        (LPSC_ACTION)((ULONG_PTR)lpPtr + (ULONG_PTR)lpPtr->lpsaActions);
             }
             break;
     }
@@ -2269,7 +2269,7 @@ QueryServiceConfig2W(SC_HANDLE hService,
 
                 if (lpPtr->lpDescription != NULL)
                     lpPtr->lpDescription =
-                        (LPWSTR)((UINT_PTR)lpPtr + (UINT_PTR)lpPtr->lpDescription);
+                        (LPWSTR)((ULONG_PTR)lpPtr + (ULONG_PTR)lpPtr->lpDescription);
             }
             break;
 
@@ -2279,15 +2279,15 @@ QueryServiceConfig2W(SC_HANDLE hService,
 
                 if (lpPtr->lpRebootMsg != NULL)
                     lpPtr->lpRebootMsg =
-                        (LPWSTR)((UINT_PTR)lpPtr + (UINT_PTR)lpPtr->lpRebootMsg);
+                        (LPWSTR)((ULONG_PTR)lpPtr + (ULONG_PTR)lpPtr->lpRebootMsg);
 
                 if (lpPtr->lpCommand != NULL)
                     lpPtr->lpCommand =
-                        (LPWSTR)((UINT_PTR)lpPtr + (UINT_PTR)lpPtr->lpCommand);
+                        (LPWSTR)((ULONG_PTR)lpPtr + (ULONG_PTR)lpPtr->lpCommand);
 
                 if (lpPtr->lpsaActions != NULL)
                     lpPtr->lpsaActions =
-                        (SC_ACTION*)((UINT_PTR)lpPtr + (UINT_PTR)lpPtr->lpsaActions);
+                        (LPSC_ACTION)((ULONG_PTR)lpPtr + (ULONG_PTR)lpPtr->lpsaActions);
             }
             break;
     }
@@ -2351,7 +2351,7 @@ QueryServiceLockStatusA(SC_HANDLE hSCManager,
     if (lpStatusPtr->lpLockOwner != NULL)
     {
         lpStatusPtr->lpLockOwner =
-            (LPSTR)((UINT_PTR)lpStatusPtr + (UINT_PTR)lpStatusPtr->lpLockOwner);
+            (LPSTR)((ULONG_PTR)lpStatusPtr + (ULONG_PTR)lpStatusPtr->lpLockOwner);
     }
 
     TRACE("QueryServiceLockStatusA() done\n");
@@ -2413,7 +2413,7 @@ QueryServiceLockStatusW(SC_HANDLE hSCManager,
     if (lpStatusPtr->lpLockOwner != NULL)
     {
         lpStatusPtr->lpLockOwner =
-            (LPWSTR)((UINT_PTR)lpStatusPtr + (UINT_PTR)lpStatusPtr->lpLockOwner);
+            (LPWSTR)((ULONG_PTR)lpStatusPtr + (ULONG_PTR)lpStatusPtr->lpLockOwner);
     }
 
     TRACE("QueryServiceLockStatusW() done\n");