Author: ion
Date: Sat Jul 23 00:30:56 2011
New Revision: 52787
URL: http://svn.reactos.org/svn/reactos?rev=52787&view=rev
Log:
[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.
Modified:
trunk/reactos/dll/win32/kernel32/client/job.c
Modified: trunk/reactos/dll/win32/kernel32/client/job.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/job.c?rev=52787&r1=52786&r2=52787&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/job.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/job.c [iso-8859-1] Sat Jul 23
00:30:56 2011
@@ -27,32 +27,8 @@
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);
}