Author: ekohl
Date: Sat Jul 16 16:18:17 2016
New Revision: 71953
URL:
http://svn.reactos.org/svn/reactos?rev=71953&view=rev
Log:
[ADVAPI32]
Remove unneeded NULL checks at CreateServiceA/W and ChangeServiceConfigW/A().
Patch by Victor Martinez Calvo.
CORE-11610 #resolve #comment Thanks a lot!
Modified:
trunk/reactos/dll/win32/advapi32/service/scm.c
Modified: trunk/reactos/dll/win32/advapi32/service/scm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Sat Jul 16 16:18:17 2016
@@ -326,7 +326,7 @@
/* FIXME: Encrypt the password */
lpEncryptedPassword = (LPBYTE)lpPasswordW;
- dwPasswordLength = (DWORD)(lpPasswordW ? (wcslen(lpPasswordW) + 1) *
sizeof(WCHAR) : 0);
+ dwPasswordLength = (wcslen(lpPasswordW) + 1) * sizeof(WCHAR);
}
RpcTryExcept
@@ -407,9 +407,12 @@
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
{
@@ -619,7 +622,7 @@
/* FIXME: Encrypt the password */
lpEncryptedPassword = (LPBYTE)lpPasswordW;
- dwPasswordLength = (DWORD)(lpPasswordW ? (wcslen(lpPasswordW) + 1) *
sizeof(WCHAR) : 0);
+ dwPasswordLength = (wcslen(lpPasswordW) + 1) * sizeof(WCHAR);
}
RpcTryExcept
@@ -714,9 +717,12 @@
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
{