mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
Minor fixes.
svn path=/trunk/; revision=449
This commit is contained in:
parent
3f9e43cbf2
commit
6bac8b1c92
1 changed files with 33 additions and 37 deletions
|
@ -23,14 +23,14 @@ CreateSemaphoreA(
|
||||||
{
|
{
|
||||||
WCHAR NameW[MAX_PATH];
|
WCHAR NameW[MAX_PATH];
|
||||||
ULONG i = 0;
|
ULONG i = 0;
|
||||||
|
|
||||||
while ((*lpName)!=0 && i < MAX_PATH)
|
while ((*lpName)!=0 && i < MAX_PATH)
|
||||||
{
|
{
|
||||||
NameW[i] = *lpName;
|
NameW[i] = *lpName;
|
||||||
lpName++;
|
lpName++;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
NameW[i] = 0;
|
NameW[i] = 0;
|
||||||
return CreateSemaphoreW(
|
return CreateSemaphoreW(
|
||||||
lpSemaphoreAttributes,
|
lpSemaphoreAttributes,
|
||||||
lInitialCount,
|
lInitialCount,
|
||||||
|
@ -55,14 +55,14 @@ CreateSemaphoreW(
|
||||||
|
|
||||||
NameString.Length = lstrlenW(lpName)*sizeof(WCHAR);
|
NameString.Length = lstrlenW(lpName)*sizeof(WCHAR);
|
||||||
NameString.Buffer = (WCHAR *)lpName;
|
NameString.Buffer = (WCHAR *)lpName;
|
||||||
NameString.MaximumLength = NameString.Length;
|
NameString.MaximumLength = NameString.Length;
|
||||||
|
|
||||||
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||||
ObjectAttributes.RootDirectory = NULL;
|
ObjectAttributes.RootDirectory = NULL;
|
||||||
ObjectAttributes.ObjectName = &NameString;
|
ObjectAttributes.ObjectName = &NameString;
|
||||||
ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE;
|
ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE;
|
||||||
ObjectAttributes.SecurityDescriptor = NULL;
|
ObjectAttributes.SecurityDescriptor = NULL;
|
||||||
ObjectAttributes.SecurityQualityOfService = NULL;
|
ObjectAttributes.SecurityQualityOfService = NULL;
|
||||||
|
|
||||||
if ( lpSemaphoreAttributes != NULL ) {
|
if ( lpSemaphoreAttributes != NULL ) {
|
||||||
ObjectAttributes.SecurityDescriptor = lpSemaphoreAttributes->lpSecurityDescriptor;
|
ObjectAttributes.SecurityDescriptor = lpSemaphoreAttributes->lpSecurityDescriptor;
|
||||||
|
@ -79,15 +79,12 @@ CreateSemaphoreW(
|
||||||
lMaximumCount
|
lMaximumCount
|
||||||
);
|
);
|
||||||
if (!NT_SUCCESS(errCode))
|
if (!NT_SUCCESS(errCode))
|
||||||
{
|
{
|
||||||
SetLastError(RtlNtStatusToDosError(errCode));
|
SetLastError(RtlNtStatusToDosError(errCode));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SemaphoreHandle;
|
return SemaphoreHandle;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE
|
HANDLE
|
||||||
|
@ -100,15 +97,15 @@ CreateMutexA(
|
||||||
{
|
{
|
||||||
WCHAR NameW[MAX_PATH];
|
WCHAR NameW[MAX_PATH];
|
||||||
ULONG i = 0;
|
ULONG i = 0;
|
||||||
|
|
||||||
while ((*lpName)!=0 && i < MAX_PATH)
|
while ((*lpName)!=0 && i < MAX_PATH)
|
||||||
{
|
{
|
||||||
NameW[i] = *lpName;
|
NameW[i] = *lpName;
|
||||||
lpName++;
|
lpName++;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
NameW[i] = 0;
|
NameW[i] = 0;
|
||||||
|
|
||||||
return CreateMutexW(
|
return CreateMutexW(
|
||||||
lpMutexAttributes,
|
lpMutexAttributes,
|
||||||
bInitialOwner,
|
bInitialOwner,
|
||||||
|
@ -131,14 +128,14 @@ CreateMutexW(
|
||||||
|
|
||||||
NameString.Length = lstrlenW(lpName)*sizeof(WCHAR);
|
NameString.Length = lstrlenW(lpName)*sizeof(WCHAR);
|
||||||
NameString.Buffer = (WCHAR *)lpName;
|
NameString.Buffer = (WCHAR *)lpName;
|
||||||
NameString.MaximumLength = NameString.Length;
|
NameString.MaximumLength = NameString.Length;
|
||||||
|
|
||||||
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||||
ObjectAttributes.RootDirectory = NULL;
|
ObjectAttributes.RootDirectory = NULL;
|
||||||
ObjectAttributes.ObjectName = &NameString;
|
ObjectAttributes.ObjectName = &NameString;
|
||||||
ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE;
|
ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE;
|
||||||
ObjectAttributes.SecurityDescriptor = NULL;
|
ObjectAttributes.SecurityDescriptor = NULL;
|
||||||
ObjectAttributes.SecurityQualityOfService = NULL;
|
ObjectAttributes.SecurityQualityOfService = NULL;
|
||||||
|
|
||||||
if ( lpMutexAttributes != NULL ) {
|
if ( lpMutexAttributes != NULL ) {
|
||||||
ObjectAttributes.SecurityDescriptor = lpMutexAttributes->lpSecurityDescriptor;
|
ObjectAttributes.SecurityDescriptor = lpMutexAttributes->lpSecurityDescriptor;
|
||||||
|
@ -149,15 +146,13 @@ CreateMutexW(
|
||||||
|
|
||||||
errCode = NtCreateMutant(&MutantHandle,GENERIC_ALL, &ObjectAttributes,(BOOLEAN)bInitialOwner);
|
errCode = NtCreateMutant(&MutantHandle,GENERIC_ALL, &ObjectAttributes,(BOOLEAN)bInitialOwner);
|
||||||
if (!NT_SUCCESS(errCode))
|
if (!NT_SUCCESS(errCode))
|
||||||
{
|
{
|
||||||
SetLastError(RtlNtStatusToDosError(errCode));
|
SetLastError(RtlNtStatusToDosError(errCode));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MutantHandle;
|
return MutantHandle;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -187,7 +182,8 @@ DWORD STDCALL WaitForSingleObjectEx(HANDLE hHandle,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Time.LowPart = dwMilliseconds;
|
Time.LowPart = dwMilliseconds;
|
||||||
|
Time.HighPart = 0;
|
||||||
TimePtr = &Time;
|
TimePtr = &Time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,8 +222,8 @@ WaitForMultipleObjectsEx(
|
||||||
LARGE_INTEGER Time;
|
LARGE_INTEGER Time;
|
||||||
DWORD retCode;
|
DWORD retCode;
|
||||||
|
|
||||||
Time.LowPart = dwMilliseconds;
|
Time.LowPart = dwMilliseconds;
|
||||||
|
Time.HighPart = 0;
|
||||||
|
|
||||||
errCode = NtWaitForMultipleObjects (
|
errCode = NtWaitForMultipleObjects (
|
||||||
nCount,
|
nCount,
|
||||||
|
|
Loading…
Reference in a new issue