mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 09:50:07 +00:00
[ADVAPI32][USER32][ROSSYM_NEW]
- Fix misuse of RtlCreateUnicodeStringFromAsciiz svn path=/trunk/; revision=56877
This commit is contained in:
parent
42e6e0b684
commit
bdc9f3ec76
|
@ -30,13 +30,11 @@ DecryptFileA(LPCSTR lpFileName,
|
|||
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 @@ BOOL WINAPI
|
|||
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 @@ FileEncryptionStatusA(LPCSTR lpFileName,
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -156,34 +156,27 @@ LogonUserA(LPSTR lpszUsername,
|
|||
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))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&UserName, lpszUsername))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
goto UsernameDone;
|
||||
}
|
||||
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&Domain,
|
||||
lpszDomain);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&Domain, lpszDomain))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
goto DomainDone;
|
||||
}
|
||||
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&Password,
|
||||
lpszPassword);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&Password, lpszPassword))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
goto PasswordDone;
|
||||
}
|
||||
|
||||
|
|
|
@ -156,11 +156,9 @@ ObjectCloseAuditAlarmA(LPCSTR SubsystemName,
|
|||
UNICODE_STRING Name;
|
||||
NTSTATUS Status;
|
||||
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&Name,
|
||||
(PCHAR)SubsystemName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&Name, SubsystemName))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -216,11 +214,9 @@ ObjectDeleteAuditAlarmA(LPCSTR SubsystemName,
|
|||
UNICODE_STRING Name;
|
||||
NTSTATUS Status;
|
||||
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&Name,
|
||||
(PCHAR)SubsystemName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&Name, SubsystemName))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -207,14 +207,11 @@ GetFileSecurityA(LPCSTR lpFileName,
|
|||
LPDWORD lpnLengthNeeded)
|
||||
{
|
||||
UNICODE_STRING FileName;
|
||||
NTSTATUS Status;
|
||||
BOOL bResult;
|
||||
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&FileName,
|
||||
(LPSTR)lpFileName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -344,14 +341,11 @@ SetFileSecurityA(LPCSTR lpFileName,
|
|||
PSECURITY_DESCRIPTOR pSecurityDescriptor)
|
||||
{
|
||||
UNICODE_STRING FileName;
|
||||
NTSTATUS Status;
|
||||
BOOL bResult;
|
||||
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&FileName,
|
||||
(LPSTR)lpFileName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1758,14 +1752,11 @@ SetNamedSecurityInfoA(LPSTR pObjectName,
|
|||
PACL pSacl)
|
||||
{
|
||||
UNICODE_STRING ObjectName;
|
||||
NTSTATUS Status;
|
||||
DWORD Ret;
|
||||
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&ObjectName,
|
||||
pObjectName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&ObjectName, pObjectName))
|
||||
{
|
||||
return RtlNtStatusToDosError(Status);
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
Ret = SetNamedSecurityInfoW(ObjectName.Buffer,
|
||||
|
@ -2260,14 +2251,11 @@ TreeResetNamedSecurityInfoA(LPSTR pObjectName,
|
|||
#else
|
||||
INERNAL_FNPROGRESSW_DATA ifnProgressData;
|
||||
UNICODE_STRING ObjectName;
|
||||
NTSTATUS Status;
|
||||
DWORD Ret;
|
||||
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&ObjectName,
|
||||
pObjectName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!RtlCreateUnicodeStringFromAsciiz(&ObjectName, pObjectName))
|
||||
{
|
||||
return RtlNtStatusToDosError(Status);
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
ifnProgressData.fnProgress = fnProgress;
|
||||
|
|
|
@ -111,8 +111,8 @@ RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo)
|
|||
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;
|
||||
|
|
|
@ -70,8 +70,8 @@ RosSymCreateFromMem(PVOID ImageStart, ULONG_PTR ImageSize, PROSSYM_INFO *RosSymI
|
|||
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;
|
||||
|
|
|
@ -281,16 +281,14 @@ RealSystemParametersInfoA(UINT uiAction,
|
|||
|
||||
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;
|
||||
|
|
|
@ -4635,7 +4635,6 @@ InsertMenuItemA(
|
|||
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 @@ InsertMenuItemA(
|
|||
((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;
|
||||
|
|
Loading…
Reference in a new issue