mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[KERNEL32]: Fix bugs #4, #5, #6. CreateJobObjectA was building a dynamic string isntead of using the TEB. It was also not returning the right error code in case of error. It was also allowing jobs to have names past 260 characters. Fixed by using the ConvertWin32AnsiObjectApiToUnicodeApi macro from 5-6 revisions ago.
svn path=/trunk/; revision=52787
This commit is contained in:
parent
59a6314a13
commit
19366d1781
1 changed files with 2 additions and 26 deletions
|
@ -27,32 +27,8 @@ WINAPI
|
|||
CreateJobObjectA(LPSECURITY_ATTRIBUTES lpJobAttributes,
|
||||
LPCSTR lpName)
|
||||
{
|
||||
HANDLE hJob;
|
||||
ANSI_STRING AnsiName;
|
||||
UNICODE_STRING UnicodeName;
|
||||
|
||||
if (lpName != NULL)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
RtlInitAnsiString(&AnsiName, lpName);
|
||||
Status = RtlAnsiStringToUnicodeString(&UnicodeName, &AnsiName, TRUE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus(Status);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
hJob = CreateJobObjectW(lpJobAttributes,
|
||||
((lpName != NULL) ? UnicodeName.Buffer : NULL));
|
||||
|
||||
if (lpName != NULL)
|
||||
{
|
||||
RtlFreeUnicodeString(&UnicodeName);
|
||||
}
|
||||
|
||||
return hJob;
|
||||
/* Call the W(ide) function */
|
||||
ConvertWin32AnsiObjectApiToUnicodeApi(JobObject, lpName, lpJobAttributes);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue