if (lpInfo == NULL) return TRUE;
- /* Fill relevent field of the Info structure */
+ /* Fill relevant field of the Info structure */
Info.dwInfoLevel = dwInfoLevel;
switch (dwInfoLevel)
{
case SERVICE_CONFIG_DESCRIPTION:
- Info.psd = (LPSERVICE_DESCRIPTIONA)&lpInfo;
- Info.lpDescription = ((LPSERVICE_DESCRIPTIONA)lpInfo)->lpDescription; //HACK
+ Info.psd = lpInfo;
break;
case SERVICE_CONFIG_FAILURE_ACTIONS:
- Info.psfa = (LPSERVICE_FAILURE_ACTIONSA)lpInfo;
+ Info.psfa = lpInfo;
break;
default:
if (lpInfo == NULL) return TRUE;
- /* Fill relevent field of the Info structure */
+ /* Fill relevant field of the Info structure */
Info.dwInfoLevel = dwInfoLevel;
switch (dwInfoLevel)
{
case SERVICE_CONFIG_DESCRIPTION:
- Info.psd = (LPSERVICE_DESCRIPTIONW)lpInfo;
+ Info.psd = lpInfo;
break;
case SERVICE_CONFIG_FAILURE_ACTIONS:
- Info.psfa = (LPSERVICE_FAILURE_ACTIONSW)lpInfo;
+ Info.psfa = lpInfo;
break;
default:
SIZE_T cchLength;
LPCSTR lpStr;
DWORD dwPasswordLength = 0;
+ LPWSTR lpPasswordW = NULL;
LPBYTE lpEncryptedPassword = NULL;
TRACE("ChangeServiceConfigA() called\n");
dwDependenciesLength++;
}
- /* FIXME: Encrypt the password */
- lpEncryptedPassword = (LPBYTE)lpPassword;
- dwPasswordLength = (DWORD)(lpPassword ? (strlen(lpPassword) + 1) * sizeof(CHAR) : 0);
+ if (lpPassword != NULL)
+ {
+ /* Convert the password to unicode */
+ lpPasswordW = HeapAlloc(GetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ (strlen(lpPassword) + 1) * sizeof(WCHAR));
+ if (lpPasswordW == NULL)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
+
+ MultiByteToWideChar(CP_ACP,
+ 0,
+ lpPassword,
+ -1,
+ lpPasswordW,
+ (int)(strlen(lpPassword) + 1));
+
+ /* FIXME: Encrypt the password */
+ lpEncryptedPassword = (LPBYTE)lpPasswordW;
+ dwPasswordLength = (wcslen(lpPasswordW) + 1) * sizeof(WCHAR);
+ }
RpcTryExcept
{
}
RpcEndExcept;
+ if (lpPasswordW != NULL)
+ HeapFree(GetProcessHeap(), 0, lpPasswordW);
+
if (dwError != ERROR_SUCCESS)
{
TRACE("RChangeServiceConfigA() failed (Error %lu)\n", dwError);
dwDependenciesLength *= sizeof(WCHAR);
}
- /* FIXME: Encrypt the password */
- lpEncryptedPassword = (LPBYTE)lpPassword;
- dwPasswordLength = (lpPassword ? (wcslen(lpPassword) + 1) * sizeof(WCHAR) : 0);
+ if (lpPassword != NULL)
+ {
+ /* FIXME: Encrypt the password */
+ lpEncryptedPassword = (LPBYTE)lpPassword;
+ dwPasswordLength = (wcslen(lpPassword) + 1) * sizeof(WCHAR);
+ }
RpcTryExcept
{
SIZE_T cchLength;
LPCSTR lpStr;
DWORD dwPasswordLength = 0;
+ LPWSTR lpPasswordW = NULL;
LPBYTE lpEncryptedPassword = NULL;
TRACE("CreateServiceA() called\n");
dwDependenciesLength++;
}
- /* FIXME: Encrypt the password */
- lpEncryptedPassword = (LPBYTE)lpPassword;
- dwPasswordLength = (DWORD)(lpPassword ? (strlen(lpPassword) + 1) * sizeof(CHAR) : 0);
+ if (lpPassword != NULL)
+ {
+ /* Convert the password to unicode */
+ lpPasswordW = HeapAlloc(GetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ (strlen(lpPassword) + 1) * sizeof(WCHAR));
+ if (lpPasswordW == NULL)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
+
+ MultiByteToWideChar(CP_ACP,
+ 0,
+ lpPassword,
+ -1,
+ lpPasswordW,
+ (int)(strlen(lpPassword) + 1));
+
+ /* FIXME: Encrypt the password */
+ lpEncryptedPassword = (LPBYTE)lpPasswordW;
+ dwPasswordLength = (wcslen(lpPasswordW) + 1) * sizeof(WCHAR);
+ }
RpcTryExcept
{
}
RpcEndExcept;
+ if (lpPasswordW != NULL)
+ HeapFree(GetProcessHeap(), 0, lpPasswordW);
+
if (dwError != ERROR_SUCCESS)
{
TRACE("RCreateServiceA() failed (Error %lu)\n", dwError);
dwDependenciesLength *= sizeof(WCHAR);
}
- /* FIXME: Encrypt the password */
- lpEncryptedPassword = (LPBYTE)lpPassword;
- dwPasswordLength = (DWORD)(lpPassword ? (wcslen(lpPassword) + 1) * sizeof(WCHAR) : 0);
+ if (lpPassword != NULL)
+ {
+ /* FIXME: Encrypt the password */
+ lpEncryptedPassword = (LPBYTE)lpPassword;
+ dwPasswordLength = (wcslen(lpPassword) + 1) * sizeof(WCHAR);
+ }
RpcTryExcept
{
}
+/**********************************************************************
+ * I_ScGetCurrentGroupStateW
+ *
+ * @implemented
+ */
+DWORD WINAPI
+I_ScGetCurrentGroupStateW(SC_HANDLE hSCManager,
+ LPWSTR pszGroupName,
+ LPDWORD pdwGroupState)
+{
+ DWORD dwError;
+
+ TRACE("I_ScGetCurrentGroupStateW() called\n");
+
+ RpcTryExcept
+ {
+ dwError = RI_ScGetCurrentGroupStateW((SC_RPC_HANDLE)hSCManager,
+ pszGroupName,
+ pdwGroupState);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ dwError = ScmRpcStatusToWinError(RpcExceptionCode());
+ }
+ RpcEndExcept
+
+ if (dwError != ERROR_SUCCESS)
+ {
+ TRACE("RI_ScGetCurrentGroupStateW() failed (Error %lu)\n", dwError);
+ SetLastError(dwError);
+ }
+
+ return dwError;
+}
+
+
/**********************************************************************
* LockServiceDatabase
*