Author: tfaber
Date: Thu Jul 12 19:48:30 2012
New Revision: 56877
URL:
http://svn.reactos.org/svn/reactos?rev=56877&view=rev
Log:
[ADVAPI32][USER32][ROSSYM_NEW]
- Fix misuse of RtlCreateUnicodeStringFromAsciiz
Modified:
trunk/reactos/dll/win32/advapi32/misc/efs.c
trunk/reactos/dll/win32/advapi32/misc/logon.c
trunk/reactos/dll/win32/advapi32/sec/audit.c
trunk/reactos/dll/win32/advapi32/sec/misc.c
trunk/reactos/lib/rossym_new/fromfile.c
trunk/reactos/lib/rossym_new/frommem.c
trunk/reactos/win32ss/user/user32/misc/desktop.c
trunk/reactos/win32ss/user/user32/windows/menu.c
Modified: trunk/reactos/dll/win32/advapi32/misc/efs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/ef…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/misc/efs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/misc/efs.c [iso-8859-1] Thu Jul 12 19:48:30 2012
@@ -30,13 +30,11 @@
DWORD dwReserved)
{
UNICODE_STRING FileName;
- NTSTATUS Status;
BOOL ret;
- Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName);
- if (!NT_SUCCESS(Status))
+ if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
{
- SetLastError(RtlNtStatusToDosError(Status));
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
@@ -67,13 +65,11 @@
EncryptFileA(LPCSTR lpFileName)
{
UNICODE_STRING FileName;
- NTSTATUS Status;
BOOL ret;
- Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName);
- if (!NT_SUCCESS(Status))
+ if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
{
- SetLastError(RtlNtStatusToDosError(Status));
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
@@ -117,17 +113,15 @@
LPDWORD lpStatus)
{
UNICODE_STRING FileName;
- NTSTATUS Status;
BOOL ret = FALSE;
TRACE("(%s, %p)\n", lpFileName, lpStatus);
FileName.Buffer = NULL;
- Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName);
- if (!NT_SUCCESS(Status))
+ if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
{
- SetLastError(RtlNtStatusToDosError(Status));
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
goto cleanup;
}
Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Thu Jul 12 19:48:30 2012
@@ -156,34 +156,27 @@
UNICODE_STRING UserName;
UNICODE_STRING Domain;
UNICODE_STRING Password;
- NTSTATUS Status;
BOOL ret = FALSE;
UserName.Buffer = NULL;
Domain.Buffer = NULL;
Password.Buffer = NULL;
- Status = RtlCreateUnicodeStringFromAsciiz(&UserName,
- lpszUsername);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
+ if (!RtlCreateUnicodeStringFromAsciiz(&UserName, lpszUsername))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
goto UsernameDone;
}
- Status = RtlCreateUnicodeStringFromAsciiz(&Domain,
- lpszDomain);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
+ if (!RtlCreateUnicodeStringFromAsciiz(&Domain, lpszDomain))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
goto DomainDone;
}
- Status = RtlCreateUnicodeStringFromAsciiz(&Password,
- lpszPassword);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
+ if (!RtlCreateUnicodeStringFromAsciiz(&Password, lpszPassword))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
goto PasswordDone;
}
Modified: trunk/reactos/dll/win32/advapi32/sec/audit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/aud…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/audit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/audit.c [iso-8859-1] Thu Jul 12 19:48:30 2012
@@ -156,11 +156,9 @@
UNICODE_STRING Name;
NTSTATUS Status;
- Status = RtlCreateUnicodeStringFromAsciiz(&Name,
- (PCHAR)SubsystemName);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
+ if (!RtlCreateUnicodeStringFromAsciiz(&Name, SubsystemName))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
@@ -216,11 +214,9 @@
UNICODE_STRING Name;
NTSTATUS Status;
- Status = RtlCreateUnicodeStringFromAsciiz(&Name,
- (PCHAR)SubsystemName);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
+ if (!RtlCreateUnicodeStringFromAsciiz(&Name, SubsystemName))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] Thu Jul 12 19:48:30 2012
@@ -207,14 +207,11 @@
LPDWORD lpnLengthNeeded)
{
UNICODE_STRING FileName;
- NTSTATUS Status;
BOOL bResult;
- Status = RtlCreateUnicodeStringFromAsciiz(&FileName,
- (LPSTR)lpFileName);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
+ if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
@@ -344,14 +341,11 @@
PSECURITY_DESCRIPTOR pSecurityDescriptor)
{
UNICODE_STRING FileName;
- NTSTATUS Status;
BOOL bResult;
- Status = RtlCreateUnicodeStringFromAsciiz(&FileName,
- (LPSTR)lpFileName);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
+ if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
@@ -1758,14 +1752,11 @@
PACL pSacl)
{
UNICODE_STRING ObjectName;
- NTSTATUS Status;
DWORD Ret;
- Status = RtlCreateUnicodeStringFromAsciiz(&ObjectName,
- pObjectName);
- if (!NT_SUCCESS(Status))
- {
- return RtlNtStatusToDosError(Status);
+ if (!RtlCreateUnicodeStringFromAsciiz(&ObjectName, pObjectName))
+ {
+ return ERROR_NOT_ENOUGH_MEMORY;
}
Ret = SetNamedSecurityInfoW(ObjectName.Buffer,
@@ -2260,14 +2251,11 @@
#else
INERNAL_FNPROGRESSW_DATA ifnProgressData;
UNICODE_STRING ObjectName;
- NTSTATUS Status;
DWORD Ret;
- Status = RtlCreateUnicodeStringFromAsciiz(&ObjectName,
- pObjectName);
- if (!NT_SUCCESS(Status))
- {
- return RtlNtStatusToDosError(Status);
+ if (!RtlCreateUnicodeStringFromAsciiz(&ObjectName, pObjectName))
+ {
+ return ERROR_NOT_ENOUGH_MEMORY;
}
ifnProgressData.fnProgress = fnProgress;
Modified: trunk/reactos/lib/rossym_new/fromfile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rossym_new/fromfile.c?…
==============================================================================
--- trunk/reactos/lib/rossym_new/fromfile.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rossym_new/fromfile.c [iso-8859-1] Thu Jul 12 19:48:30 2012
@@ -111,8 +111,8 @@
NTSTATUS Status;
ULONG StringOffset;
- Status = RtlCreateUnicodeStringFromAsciiz(&intConv,
(PCSZ)SectionHeaders[SectionIndex].Name + 1);
- if (!NT_SUCCESS(Status)) goto freeall;
+ if (!RtlCreateUnicodeStringFromAsciiz(&intConv,
(PCSZ)SectionHeaders[SectionIndex].Name + 1))
+ goto freeall;
Status = RtlUnicodeStringToInteger(&intConv, 10, &StringOffset);
RtlFreeUnicodeString(&intConv);
if (!NT_SUCCESS(Status)) goto freeall;
Modified: trunk/reactos/lib/rossym_new/frommem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rossym_new/frommem.c?r…
==============================================================================
--- trunk/reactos/lib/rossym_new/frommem.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rossym_new/frommem.c [iso-8859-1] Thu Jul 12 19:48:30 2012
@@ -70,8 +70,8 @@
NTSTATUS Status;
ULONG StringOffset;
- Status = RtlCreateUnicodeStringFromAsciiz(&intConv,
(PCSZ)SectionHeaders[SectionIndex].Name + 1);
- if (!NT_SUCCESS(Status)) goto freeall;
+ if (!RtlCreateUnicodeStringFromAsciiz(&intConv,
(PCSZ)SectionHeaders[SectionIndex].Name + 1))
+ goto freeall;
Status = RtlUnicodeStringToInteger(&intConv, 10, &StringOffset);
RtlFreeUnicodeString(&intConv);
if (!NT_SUCCESS(Status)) goto freeall;
Modified: trunk/reactos/win32ss/user/user32/misc/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/d…
==============================================================================
--- trunk/reactos/win32ss/user/user32/misc/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/misc/desktop.c [iso-8859-1] Thu Jul 12 19:48:30
2012
@@ -281,16 +281,14 @@
case SPI_SETDESKWALLPAPER:
{
- NTSTATUS Status;
UNICODE_STRING ustrWallpaper;
BOOL Ret;
if (pvParam)
{
- Status = RtlCreateUnicodeStringFromAsciiz(&ustrWallpaper, pvParam);
- if (!NT_SUCCESS(Status))
+ if (!RtlCreateUnicodeStringFromAsciiz(&ustrWallpaper, pvParam))
{
- ERR("Status = 0x%x\n", Status);
+ ERR("RtlCreateUnicodeStringFromAsciiz failed\n");
return FALSE;
}
pvParam = &ustrWallpaper;
Modified: trunk/reactos/win32ss/user/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] Thu Jul 12 19:48:30
2012
@@ -4635,7 +4635,6 @@
UNICODE_STRING MenuText;
BOOL res = FALSE;
BOOL CleanHeap = FALSE;
- NTSTATUS Status;
if((lpmii->cbSize == sizeof(MENUITEMINFOA)) ||
(lpmii->cbSize == sizeof(MENUITEMINFOA) - sizeof(HBITMAP)))
@@ -4652,10 +4651,9 @@
((mi.fMask & MIIM_TYPE) && (MENU_ITEM_TYPE(mi.fType) == MF_STRING)))
&& mi.dwTypeData != NULL)
{
- Status = RtlCreateUnicodeStringFromAsciiz(&MenuText, (LPSTR)mi.dwTypeData);
- if (!NT_SUCCESS (Status))
+ if (!RtlCreateUnicodeStringFromAsciiz(&MenuText, (LPSTR)mi.dwTypeData))
{
- SetLastError (RtlNtStatusToDosError(Status));
+ SetLastError (ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
mi.dwTypeData = MenuText.Buffer;