minor fixes

svn path=/trunk/; revision=11412
This commit is contained in:
Thomas Bluemel 2004-10-24 12:26:27 +00:00
parent 0dd86887a1
commit 565f4d669b
3 changed files with 32 additions and 24 deletions

View file

@ -1,4 +1,4 @@
/* $Id: mutex.c,v 1.9 2004/10/24 12:16:54 weiden Exp $
/* $Id: mutex.c,v 1.10 2004/10/24 12:26:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -31,17 +31,24 @@ CreateMutexA(LPSECURITY_ATTRIBUTES lpMutexAttributes,
ANSI_STRING Name;
HANDLE Handle;
RtlInitAnsiString(&Name,
(LPSTR)lpName);
RtlAnsiStringToUnicodeString(&NameU,
&Name,
TRUE);
if (lpName != NULL)
{
RtlInitAnsiString(&Name,
(LPSTR)lpName);
RtlAnsiStringToUnicodeString(&NameU,
&Name,
TRUE);
}
Handle = CreateMutexW(lpMutexAttributes,
bInitialOwner,
NameU.Buffer);
(lpName ? NameU.Buffer : NULL));
RtlFreeUnicodeString(&NameU);
if (lpName != NULL)
{
RtlFreeUnicodeString(&NameU);
}
return Handle;
}

View file

@ -1,4 +1,4 @@
/* $Id: sem.c,v 1.9 2004/10/24 12:16:54 weiden Exp $
/* $Id: sem.c,v 1.10 2004/10/24 12:26:27 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -32,18 +32,24 @@ CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
ANSI_STRING Name;
HANDLE Handle;
RtlInitAnsiString(&Name,
(LPSTR)lpName);
RtlAnsiStringToUnicodeString(&NameU,
&Name,
TRUE);
if (lpName != NULL)
{
RtlInitAnsiString(&Name,
(LPSTR)lpName);
RtlAnsiStringToUnicodeString(&NameU,
&Name,
TRUE);
}
Handle = CreateSemaphoreW(lpSemaphoreAttributes,
lInitialCount,
lMaximumCount,
NameU.Buffer);
(lpName ? NameU.Buffer : NULL));
RtlFreeUnicodeString (&NameU);
if (lpName != NULL)
{
RtlFreeUnicodeString (&NameU);
}
return Handle;
}

View file

@ -1,4 +1,4 @@
/* $Id: timer.c,v 1.17 2004/10/24 12:16:54 weiden Exp $
/* $Id: timer.c,v 1.18 2004/10/24 12:26:27 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -29,17 +29,12 @@ CreateWaitableTimerW(LPSECURITY_ATTRIBUTES lpTimerAttributes,
HANDLE TimerHandle;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING UnicodeName;
ULONG TimerType;
if (bManualReset)
TimerType = NotificationTimer;
else
TimerType = SynchronizationTimer;
if (lpTimerName)
{
RtlInitUnicodeString(&UnicodeName, lpTimerName);
}
InitializeObjectAttributes(&ObjectAttributes,
(lpTimerName ? &UnicodeName : NULL),
0,
@ -58,7 +53,7 @@ CreateWaitableTimerW(LPSECURITY_ATTRIBUTES lpTimerAttributes,
Status = NtCreateTimer(&TimerHandle,
TIMER_ALL_ACCESS,
&ObjectAttributes,
TimerType);
(bManualReset ? NotificationTimer : SynchronizationTimer));
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);