Author: greatlrd
Date: Sat Aug 26 18:28:34 2006
New Revision: 23719
URL:
http://svn.reactos.org/svn/reactos?rev=23719&view=rev
Log:
bug 1769 : from w3seek : Implement some new functions
Modified:
trunk/reactos/dll/win32/kernel32/kernel32.def
trunk/reactos/dll/win32/kernel32/kernel32.rbuild
trunk/reactos/dll/win32/kernel32/synch/event.c
trunk/reactos/dll/win32/kernel32/synch/mutex.c
trunk/reactos/dll/win32/kernel32/synch/sem.c
trunk/reactos/dll/win32/kernel32/synch/timer.c
trunk/reactos/dll/win32/kernel32/synch/wait.c
trunk/reactos/include/psdk/winbase.h
Modified: trunk/reactos/dll/win32/kernel32/kernel32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/kernel32.def (original)
+++ trunk/reactos/dll/win32/kernel32/kernel32.def Sat Aug 26 18:28:34 2006
@@ -109,6 +109,8 @@
CreateDirectoryW@8
CreateEventA@16
CreateEventW@16
+CreateEventExA@16
+CreateEventExW@16
CreateFiber@12
CreateFiberEx@20
CreateFileA@28
@@ -126,6 +128,8 @@
CreateMemoryResourceNotification@4
CreateMutexA@12
CreateMutexW@12
+CreateMutexExA@16
+CreateMutexExW@16
CreateNamedPipeA@32
CreateNamedPipeW@32
CreateNlsSecurityDescriptor@12
@@ -137,6 +141,8 @@
CreateRemoteThread@28
CreateSemaphoreA@16
CreateSemaphoreW@16
+CreateSemaphoreExA@24
+CreateSemaphoreExW@24
CreateSocketHandle@0
CreateSymbolicLinkA@12
CreateSymbolicLinkW@12
@@ -148,6 +154,8 @@
CreateVirtualBuffer@12
CreateWaitableTimerA@12
CreateWaitableTimerW@12
+CreateWaitableTimerExA@16
+CreateWaitableTimerExW@16
DeactivateActCtx@8
DebugActiveProcess@4
DebugActiveProcessStop@4
Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/kernel32.rbuild (original)
+++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild Sat Aug 26 18:28:34 2006
@@ -8,7 +8,12 @@
<define name="_WIN32_WINNT">0x0502</define>
<define name="__NO_CTYPE_INLINES" />
<define name="WINVER">0x502</define>
+<!--
+ !!! DO NOT ENABLE PCH! SOME FILES ARE NOT PCH-SAFE AS THEY DEFINE !!!
+ !!! _WIN32_WINNT DIFFERENTLY BEFORE INCLUDING k32.h !!!
+
<pch>k32.h</pch>
+-->
<directory name="debug">
<file>debugger.c</file>
<file>output.c</file>
Modified: trunk/reactos/dll/win32/kernel32/synch/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/e…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/event.c (original)
+++ trunk/reactos/dll/win32/kernel32/synch/event.c Sat Aug 26 18:28:34 2006
@@ -8,6 +8,10 @@
/* INCLUDES *****************************************************************/
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
#include <k32.h>
#define NDEBUG
@@ -17,10 +21,10 @@
HANDLE
WINAPI
-CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL,
- IN BOOL bManualReset,
- IN BOOL bInitialState,
- IN LPCSTR lpName OPTIONAL)
+CreateEventExA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL,
+ IN LPCSTR lpName OPTIONAL,
+ IN DWORD dwFlags,
+ IN DWORD dwDesiredAccess)
{
NTSTATUS Status;
ANSI_STRING AnsiName;
@@ -48,27 +52,39 @@
}
/* Call the Unicode API */
- return CreateEventW(lpEventAttributes,
- bManualReset,
- bInitialState,
- UnicodeName);
-}
-
-HANDLE
-WINAPI
-CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL,
- IN BOOL bManualReset,
- IN BOOL bInitialState,
- IN LPCWSTR lpName OPTIONAL)
+ return CreateEventExW(lpEventAttributes,
+ UnicodeName,
+ dwFlags,
+ dwDesiredAccess);
+
+}
+
+HANDLE
+WINAPI
+CreateEventExW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL,
+ IN LPCWSTR lpName OPTIONAL,
+ IN DWORD dwFlags,
+ IN DWORD dwDesiredAccess)
{
NTSTATUS Status;
OBJECT_ATTRIBUTES LocalAttributes;
POBJECT_ATTRIBUTES ObjectAttributes;
HANDLE Handle;
UNICODE_STRING ObjectName;
+ BOOLEAN InitialState;
+ EVENT_TYPE EventType;
/* Now check if we got a name */
if (lpName) RtlInitUnicodeString(&ObjectName, lpName);
+
+ if (dwFlags & ~(CREATE_EVENT_INITIAL_SET | CREATE_EVENT_MANUAL_RESET))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+
+ InitialState = (dwFlags & CREATE_EVENT_INITIAL_SET) != 0;
+ EventType = (dwFlags & CREATE_EVENT_MANUAL_RESET) ? NotificationEvent :
SynchronizationEvent;
/* Now convert the object attributes */
ObjectAttributes = BasepConvertObjectAttributes(&LocalAttributes,
@@ -77,11 +93,10 @@
/* Create the event */
Status = NtCreateEvent(&Handle,
- EVENT_ALL_ACCESS,
+ (ACCESS_MASK)dwDesiredAccess,
ObjectAttributes,
- bManualReset ?
- NotificationEvent : SynchronizationEvent,
- (BOOLEAN)bInitialState);
+ EventType,
+ InitialState);
if (NT_SUCCESS(Status))
{
/* Check if the object already existed */
@@ -105,6 +120,49 @@
SetLastErrorByStatus(Status);
return NULL;
}
+
+}
+
+HANDLE
+WINAPI
+CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL,
+ IN BOOL bManualReset,
+ IN BOOL bInitialState,
+ IN LPCSTR lpName OPTIONAL)
+{
+ DWORD dwFlags = 0;
+
+ if (bManualReset)
+ dwFlags |= CREATE_EVENT_MANUAL_RESET;
+
+ if (bInitialState)
+ dwFlags |= CREATE_EVENT_INITIAL_SET;
+
+ return CreateEventExA(lpEventAttributes,
+ lpName,
+ dwFlags,
+ EVENT_ALL_ACCESS);
+}
+
+HANDLE
+WINAPI
+CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL,
+ IN BOOL bManualReset,
+ IN BOOL bInitialState,
+ IN LPCWSTR lpName OPTIONAL)
+{
+ DWORD dwFlags = 0;
+
+ if (bManualReset)
+ dwFlags |= CREATE_EVENT_MANUAL_RESET;
+
+ if (bInitialState)
+ dwFlags |= CREATE_EVENT_INITIAL_SET;
+
+ return CreateEventExW(lpEventAttributes,
+ lpName,
+ dwFlags,
+ EVENT_ALL_ACCESS);
}
HANDLE
Modified: trunk/reactos/dll/win32/kernel32/synch/mutex.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/m…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/mutex.c (original)
+++ trunk/reactos/dll/win32/kernel32/synch/mutex.c Sat Aug 26 18:28:34 2006
@@ -8,6 +8,10 @@
/* INCLUDES *****************************************************************/
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
#include <k32.h>
#define NDEBUG
@@ -20,9 +24,10 @@
*/
HANDLE
WINAPI
-CreateMutexA(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL,
- IN BOOL bInitialOwner,
- IN LPCSTR lpName OPTIONAL)
+CreateMutexExA(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL,
+ IN LPCSTR lpName OPTIONAL,
+ IN DWORD dwFlags,
+ IN DWORD dwDesiredAccess)
{
NTSTATUS Status;
ANSI_STRING AnsiName;
@@ -50,28 +55,39 @@
}
/* Call the Unicode API */
- return CreateMutexW(lpMutexAttributes,
- bInitialOwner,
- UnicodeName);
-}
-
-/*
- * @implemented
- */
-HANDLE
-WINAPI
-CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL,
- IN BOOL bInitialOwner,
- IN LPCWSTR lpName OPTIONAL)
+ return CreateMutexExW(lpMutexAttributes,
+ UnicodeName,
+ dwFlags,
+ dwDesiredAccess);
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+CreateMutexExW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL,
+ IN LPCWSTR lpName OPTIONAL,
+ IN DWORD dwFlags,
+ IN DWORD dwDesiredAccess)
{
NTSTATUS Status;
OBJECT_ATTRIBUTES LocalAttributes;
POBJECT_ATTRIBUTES ObjectAttributes;
HANDLE Handle;
UNICODE_STRING ObjectName;
+ BOOLEAN InitialOwner;
/* Now check if we got a name */
if (lpName) RtlInitUnicodeString(&ObjectName, lpName);
+
+ if (dwFlags & ~(CREATE_MUTEX_INITIAL_OWNER))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+
+ InitialOwner = (dwFlags & CREATE_MUTEX_INITIAL_OWNER) != 0;
/* Now convert the object attributes */
ObjectAttributes = BasepConvertObjectAttributes(&LocalAttributes,
@@ -80,9 +96,9 @@
/* Create the mutant */
Status = NtCreateMutant(&Handle,
- MUTANT_ALL_ACCESS,
+ (ACCESS_MASK)dwDesiredAccess,
ObjectAttributes,
- (BOOLEAN)bInitialOwner);
+ InitialOwner);
if (NT_SUCCESS(Status))
{
/* Check if the object already existed */
@@ -106,6 +122,47 @@
SetLastErrorByStatus(Status);
return NULL;
}
+
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+CreateMutexA(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL,
+ IN BOOL bInitialOwner,
+ IN LPCSTR lpName OPTIONAL)
+{
+ DWORD dwFlags = 0;
+
+ if (bInitialOwner)
+ dwFlags |= CREATE_MUTEX_INITIAL_OWNER;
+
+ return CreateMutexExA(lpMutexAttributes,
+ lpName,
+ dwFlags,
+ MUTANT_ALL_ACCESS);
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL,
+ IN BOOL bInitialOwner,
+ IN LPCWSTR lpName OPTIONAL)
+{
+ DWORD dwFlags = 0;
+
+ if (bInitialOwner)
+ dwFlags |= CREATE_MUTEX_INITIAL_OWNER;
+
+ return CreateMutexExW(lpMutexAttributes,
+ lpName,
+ dwFlags,
+ MUTANT_ALL_ACCESS);
}
/*
Modified: trunk/reactos/dll/win32/kernel32/synch/sem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/s…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/sem.c (original)
+++ trunk/reactos/dll/win32/kernel32/synch/sem.c Sat Aug 26 18:28:34 2006
@@ -8,6 +8,10 @@
/* INCLUDES *****************************************************************/
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
#include <k32.h>
#define NDEBUG
@@ -20,10 +24,12 @@
*/
HANDLE
WINAPI
-CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL,
- IN LONG lInitialCount,
- IN LONG lMaximumCount,
- IN LPCSTR lpName OPTIONAL)
+CreateSemaphoreExA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL,
+ IN LONG lInitialCount,
+ IN LONG lMaximumCount,
+ IN LPCSTR lpName OPTIONAL,
+ IN DWORD dwFlags,
+ IN DWORD dwDesiredAccess)
{
NTSTATUS Status;
ANSI_STRING AnsiName;
@@ -51,21 +57,25 @@
}
/* Call the Unicode API */
- return CreateSemaphoreW(lpSemaphoreAttributes,
- lInitialCount,
- lMaximumCount,
- UnicodeName);
-}
-
-/*
- * @implemented
- */
-HANDLE
-WINAPI
-CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL,
- IN LONG lInitialCount,
- IN LONG lMaximumCount,
- IN LPCWSTR lpName OPTIONAL)
+ return CreateSemaphoreExW(lpSemaphoreAttributes,
+ lInitialCount,
+ lMaximumCount,
+ UnicodeName,
+ dwFlags,
+ dwDesiredAccess);
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+CreateSemaphoreExW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL,
+ IN LONG lInitialCount,
+ IN LONG lMaximumCount,
+ IN LPCWSTR lpName OPTIONAL,
+ IN DWORD dwFlags,
+ IN DWORD dwDesiredAccess)
{
NTSTATUS Status;
OBJECT_ATTRIBUTES LocalAttributes;
@@ -76,6 +86,12 @@
/* Now check if we got a name */
if (lpName) RtlInitUnicodeString(&ObjectName, lpName);
+ if (dwFlags != 0)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+
/* Now convert the object attributes */
ObjectAttributes = BasepConvertObjectAttributes(&LocalAttributes,
lpSemaphoreAttributes,
@@ -83,7 +99,7 @@
/* Create the semaphore */
Status = NtCreateSemaphore(&Handle,
- SEMAPHORE_ALL_ACCESS,
+ (ACCESS_MASK)dwDesiredAccess,
ObjectAttributes,
lInitialCount,
lMaximumCount);
@@ -110,6 +126,44 @@
SetLastErrorByStatus(Status);
return NULL;
}
+
+}
+
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL,
+ IN LONG lInitialCount,
+ IN LONG lMaximumCount,
+ IN LPCSTR lpName OPTIONAL)
+{
+ return CreateSemaphoreExA(lpSemaphoreAttributes,
+ lInitialCount,
+ lMaximumCount,
+ lpName,
+ 0,
+ SEMAPHORE_ALL_ACCESS);
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL,
+ IN LONG lInitialCount,
+ IN LONG lMaximumCount,
+ IN LPCWSTR lpName OPTIONAL)
+{
+ return CreateSemaphoreExW(lpSemaphoreAttributes,
+ lInitialCount,
+ lMaximumCount,
+ lpName,
+ 0,
+ SEMAPHORE_ALL_ACCESS);
}
/*
Modified: trunk/reactos/dll/win32/kernel32/synch/timer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/t…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/timer.c (original)
+++ trunk/reactos/dll/win32/kernel32/synch/timer.c Sat Aug 26 18:28:34 2006
@@ -8,6 +8,10 @@
/* INCLUDES *****************************************************************/
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
#include <k32.h>
#define NDEBUG
@@ -20,18 +24,70 @@
*/
HANDLE
WINAPI
-CreateWaitableTimerW(IN LPSECURITY_ATTRIBUTES lpTimerAttributes OPTIONAL,
- IN BOOL bManualReset,
- IN LPCWSTR lpTimerName OPTIONAL)
+CreateWaitableTimerExA(IN LPSECURITY_ATTRIBUTES lpTimerAttributes OPTIONAL,
+ IN LPCSTR lpTimerName OPTIONAL,
+ IN DWORD dwFlags,
+ IN DWORD dwDesiredAccess)
+{
+ NTSTATUS Status;
+ ANSI_STRING AnsiName;
+ PUNICODE_STRING UnicodeCache;
+ LPCWSTR UnicodeName = NULL;
+
+ /* Check for a name */
+ if (lpTimerName)
+ {
+ /* Use TEB Cache */
+ UnicodeCache = &NtCurrentTeb()->StaticUnicodeString;
+
+ /* Convert to unicode */
+ RtlInitAnsiString(&AnsiName, lpTimerName);
+ Status = RtlAnsiStringToUnicodeString(UnicodeCache, &AnsiName, FALSE);
+ if (!NT_SUCCESS(Status))
+ {
+ /* Conversion failed */
+ SetLastErrorByStatus(Status);
+ return NULL;
+ }
+
+ /* Otherwise, save the buffer */
+ UnicodeName = (LPCWSTR)UnicodeCache->Buffer;
+ }
+
+ /* Call the Unicode API */
+ return CreateWaitableTimerExW(lpTimerAttributes,
+ UnicodeName,
+ dwFlags,
+ dwDesiredAccess);
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+CreateWaitableTimerExW(IN LPSECURITY_ATTRIBUTES lpTimerAttributes OPTIONAL,
+ IN LPCWSTR lpTimerName OPTIONAL,
+ IN DWORD dwFlags,
+ IN DWORD dwDesiredAccess)
{
NTSTATUS Status;
OBJECT_ATTRIBUTES LocalAttributes;
POBJECT_ATTRIBUTES ObjectAttributes;
HANDLE Handle;
UNICODE_STRING ObjectName;
+ TIMER_TYPE TimerType;
/* Now check if we got a name */
if (lpTimerName) RtlInitUnicodeString(&ObjectName, lpTimerName);
+
+ if (dwFlags & ~(CREATE_WAITABLE_TIMER_MANUAL_RESET))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+
+ TimerType = (dwFlags & CREATE_WAITABLE_TIMER_MANUAL_RESET) ? NotificationTimer :
SynchronizationTimer;
/* Now convert the object attributes */
ObjectAttributes = BasepConvertObjectAttributes(&LocalAttributes,
@@ -40,10 +96,9 @@
/* Create the timer */
Status = NtCreateTimer(&Handle,
- TIMER_ALL_ACCESS,
+ (ACCESS_MASK)dwDesiredAccess,
ObjectAttributes,
- bManualReset ?
- NotificationTimer : SynchronizationTimer);
+ TimerType);
if (NT_SUCCESS(Status))
{
/* Check if the object already existed */
@@ -67,6 +122,27 @@
SetLastErrorByStatus(Status);
return NULL;
}
+
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+CreateWaitableTimerW(IN LPSECURITY_ATTRIBUTES lpTimerAttributes OPTIONAL,
+ IN BOOL bManualReset,
+ IN LPCWSTR lpTimerName OPTIONAL)
+{
+ DWORD dwFlags = 0;
+
+ if (bManualReset)
+ dwFlags |= CREATE_WAITABLE_TIMER_MANUAL_RESET;
+
+ return CreateWaitableTimerExW(lpTimerAttributes,
+ lpTimerName,
+ dwFlags,
+ TIMER_ALL_ACCESS);
}
/*
@@ -78,10 +154,72 @@
IN BOOL bManualReset,
IN LPCSTR lpTimerName OPTIONAL)
{
+ DWORD dwFlags = 0;
+
+ if (bManualReset)
+ dwFlags |= CREATE_WAITABLE_TIMER_MANUAL_RESET;
+
+ return CreateWaitableTimerExA(lpTimerAttributes,
+ lpTimerName,
+ dwFlags,
+ TIMER_ALL_ACCESS);
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+OpenWaitableTimerW(IN DWORD dwDesiredAccess,
+ IN BOOL bInheritHandle,
+ IN LPCWSTR lpTimerName)
+{
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ UNICODE_STRING ObjectName;
+ NTSTATUS Status;
+ HANDLE Handle;
+
+ /* Make sure we got a name */
+ if (!lpTimerName)
+ {
+ /* Fail without one */
+ SetLastErrorByStatus(STATUS_INVALID_PARAMETER);
+ return NULL;
+ }
+
+ /* Initialize the object name and attributes */
+ RtlInitUnicodeString(&ObjectName, lpTimerName);
+ InitializeObjectAttributes(&ObjectAttributes,
+ &ObjectName,
+ bInheritHandle ? OBJ_INHERIT : 0,
+ hBaseDir,
+ NULL);
+
+ /* Open the timer */
+ Status = NtOpenTimer(&Handle, dwDesiredAccess, &ObjectAttributes);
+ if (!NT_SUCCESS(Status))
+ {
+ /* Convert the status and fail */
+ SetLastErrorByStatus(Status);
+ return NULL;
+ }
+
+ /* Return the handle */
+ return Handle;
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+WINAPI
+OpenWaitableTimerA(IN DWORD dwDesiredAccess,
+ IN BOOL bInheritHandle,
+ IN LPCSTR lpTimerName)
+{
NTSTATUS Status;
ANSI_STRING AnsiName;
PUNICODE_STRING UnicodeCache;
- LPCWSTR UnicodeName = NULL;
/* Check for a name */
if (lpTimerName)
@@ -98,88 +236,6 @@
SetLastErrorByStatus(Status);
return NULL;
}
-
- /* Otherwise, save the buffer */
- UnicodeName = (LPCWSTR)UnicodeCache->Buffer;
- }
-
- /* Call the Unicode API */
- return CreateWaitableTimerW(lpTimerAttributes,
- bManualReset,
- UnicodeName);
-}
-
-/*
- * @implemented
- */
-HANDLE
-WINAPI
-OpenWaitableTimerW(IN DWORD dwDesiredAccess,
- IN BOOL bInheritHandle,
- IN LPCWSTR lpTimerName)
-{
- OBJECT_ATTRIBUTES ObjectAttributes;
- UNICODE_STRING ObjectName;
- NTSTATUS Status;
- HANDLE Handle;
-
- /* Make sure we got a name */
- if (!lpTimerName)
- {
- /* Fail without one */
- SetLastErrorByStatus(STATUS_INVALID_PARAMETER);
- return NULL;
- }
-
- /* Initialize the object name and attributes */
- RtlInitUnicodeString(&ObjectName, lpTimerName);
- InitializeObjectAttributes(&ObjectAttributes,
- &ObjectName,
- bInheritHandle ? OBJ_INHERIT : 0,
- hBaseDir,
- NULL);
-
- /* Open the timer */
- Status = NtOpenTimer(&Handle, dwDesiredAccess, &ObjectAttributes);
- if (!NT_SUCCESS(Status))
- {
- /* Convert the status and fail */
- SetLastErrorByStatus(Status);
- return NULL;
- }
-
- /* Return the handle */
- return Handle;
-}
-
-/*
- * @implemented
- */
-HANDLE
-WINAPI
-OpenWaitableTimerA(IN DWORD dwDesiredAccess,
- IN BOOL bInheritHandle,
- IN LPCSTR lpTimerName)
-{
- NTSTATUS Status;
- ANSI_STRING AnsiName;
- PUNICODE_STRING UnicodeCache;
-
- /* Check for a name */
- if (lpTimerName)
- {
- /* Use TEB Cache */
- UnicodeCache = &NtCurrentTeb()->StaticUnicodeString;
-
- /* Convert to unicode */
- RtlInitAnsiString(&AnsiName, lpTimerName);
- Status = RtlAnsiStringToUnicodeString(UnicodeCache, &AnsiName, FALSE);
- if (!NT_SUCCESS(Status))
- {
- /* Conversion failed */
- SetLastErrorByStatus(Status);
- return NULL;
- }
}
else
{
Modified: trunk/reactos/dll/win32/kernel32/synch/wait.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/w…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/wait.c (original)
+++ trunk/reactos/dll/win32/kernel32/synch/wait.c Sat Aug 26 18:28:34 2006
@@ -7,6 +7,10 @@
*/
/* INCLUDES *****************************************************************/
+
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
#include <k32.h>
Modified: trunk/reactos/include/psdk/winbase.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/winbase.h (original)
+++ trunk/reactos/include/psdk/winbase.h Sat Aug 26 18:28:34 2006
@@ -534,6 +534,12 @@
#define GET_MODULE_HANDLE_EX_FLAG_PIN 0x1
#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 0x2
#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x4
+#endif
+#if (_WIN32_WINNT >= 0x0600)
+#define CREATE_EVENT_MANUAL_RESET 0x1
+#define CREATE_EVENT_INITIAL_SET 0x2
+#define CREATE_MUTEX_INITIAL_OWNER 0x1
+#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x1
#endif
#ifndef RC_INVOKED
@@ -1179,6 +1185,10 @@
BOOL WINAPI CreateDirectoryExW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES);
HANDLE WINAPI CreateEventA(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCSTR);
HANDLE WINAPI CreateEventW(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCWSTR);
+#if (_WIN32_WINNT >= 0x0600)
+HANDLE WINAPI CreateEventExA(LPSECURITY_ATTRIBUTES,LPCSTR,DWORD,DWORD);
+HANDLE WINAPI CreateEventExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD);
+#endif
LPVOID WINAPI CreateFiber(SIZE_T,LPFIBER_START_ROUTINE,LPVOID);
#if (_WIN32_WINNT >= 0x0400)
LPVOID WINAPI CreateFiberEx(SIZE_T,SIZE_T,DWORD,LPFIBER_START_ROUTINE,LPVOID);
@@ -1205,6 +1215,10 @@
#endif
HANDLE WINAPI CreateMutexA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
HANDLE WINAPI CreateMutexW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
+#if (_WIN32_WINNT >= 0x0600)
+HANDLE WINAPI CreateMutexExA(LPSECURITY_ATTRIBUTES,LPCSTR,DWORD,DWORD);
+HANDLE WINAPI CreateMutexExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD);
+#endif
HANDLE WINAPI
CreateNamedPipeA(LPCSTR,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
HANDLE WINAPI
CreateNamedPipeW(LPCWSTR,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
BOOL WINAPI CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD);
@@ -1216,6 +1230,10 @@
HANDLE WINAPI
CreateRemoteThread(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
HANDLE WINAPI CreateSemaphoreA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR);
HANDLE WINAPI CreateSemaphoreW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);
+#if (_WIN32_WINNT >= 0x0600)
+HANDLE WINAPI CreateSemaphoreExA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR,DWORD,DWORD);
+HANDLE WINAPI CreateSemaphoreExW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR,DWORD,DWORD);
+#endif
DWORD WINAPI CreateTapePartition(HANDLE,DWORD,DWORD,DWORD);
#if (_WIN32_WINNT >= 0x0500)
HANDLE WINAPI CreateTimerQueue(void);
@@ -1224,6 +1242,10 @@
HANDLE WINAPI
CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,PVOID,DWORD,PDWORD);
HANDLE WINAPI CreateWaitableTimerA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
HANDLE WINAPI CreateWaitableTimerW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
+#if (_WIN32_WINNT >= 0x0600)
+HANDLE WINAPI CreateWaitableTimerExA(LPSECURITY_ATTRIBUTES,LPCSTR,DWORD,DWORD);
+HANDLE WINAPI CreateWaitableTimerExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD);
+#endif
#if (_WIN32_WINNT >= 0x0501)
BOOL WINAPI CreateWellKnownSid(WELL_KNOWN_SID_TYPE,PSID,PSID,DWORD*);
BOOL WINAPI DeactivateActCtx(DWORD,ULONG_PTR);