Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b1c3c8c8
Commit
b1c3c8c8
authored
Jul 22, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Added InitOnceInitialize() implementation.
parent
77ad893a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
0 deletions
+39
-0
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-0
sync.c
dlls/kernel32/tests/sync.c
+18
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
sync.c
dlls/ntdll/sync.c
+5
-0
winbase.h
include/winbase.h
+7
-0
winnt.h
include/winnt.h
+7
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
b1c3c8c8
...
...
@@ -747,6 +747,7 @@
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long)
@ stdcall InitializeCriticalSectionEx(ptr long long)
@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead
@ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
@ stdcall -arch=i386 InterlockedCompareExchange (ptr long long)
@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr int64 int64) ntdll.RtlInterlockedCompareExchange64
@ stdcall -arch=i386 InterlockedDecrement(ptr)
...
...
dlls/kernel32/tests/sync.c
View file @
b1c3c8c8
...
...
@@ -37,6 +37,7 @@ static BOOL (WINAPI *pDeleteTimerQueueTimer)(HANDLE, HANDLE, HANDLE);
static
HANDLE
(
WINAPI
*
pOpenWaitableTimerA
)(
DWORD
,
BOOL
,
LPCSTR
);
static
HANDLE
(
WINAPI
*
pCreateMemoryResourceNotification
)(
MEMORY_RESOURCE_NOTIFICATION_TYPE
);
static
BOOL
(
WINAPI
*
pQueryMemoryResourceNotification
)(
HANDLE
,
PBOOL
);
static
VOID
(
WINAPI
*
pInitOnceInitialize
)(
PINIT_ONCE
);
static
void
test_signalandwait
(
void
)
{
...
...
@@ -1135,6 +1136,21 @@ static void test_WaitForMultipleObjects(void)
if
(
maxevents
[
i
])
CloseHandle
(
maxevents
[
i
]);
}
static
void
test_initonce
(
void
)
{
INIT_ONCE
initonce
;
if
(
!
pInitOnceInitialize
)
{
win_skip
(
"one-time initialization API not supported
\n
"
);
return
;
}
initonce
.
Ptr
=
(
void
*
)
0xdeadbeef
;
pInitOnceInitialize
(
&
initonce
);
ok
(
initonce
.
Ptr
==
NULL
,
"got %p
\n
"
,
initonce
.
Ptr
);
}
START_TEST
(
sync
)
{
HMODULE
hdll
=
GetModuleHandle
(
"kernel32"
);
...
...
@@ -1147,6 +1163,7 @@ START_TEST(sync)
pOpenWaitableTimerA
=
(
void
*
)
GetProcAddress
(
hdll
,
"OpenWaitableTimerA"
);
pCreateMemoryResourceNotification
=
(
void
*
)
GetProcAddress
(
hdll
,
"CreateMemoryResourceNotification"
);
pQueryMemoryResourceNotification
=
(
void
*
)
GetProcAddress
(
hdll
,
"QueryMemoryResourceNotification"
);
pInitOnceInitialize
=
(
void
*
)
GetProcAddress
(
hdll
,
"InitOnceInitialize"
);
test_signalandwait
();
test_mutex
();
...
...
@@ -1158,4 +1175,5 @@ START_TEST(sync)
test_timer_queue
();
test_WaitForSingleObject
();
test_WaitForMultipleObjects
();
test_initonce
();
}
dlls/ntdll/ntdll.spec
View file @
b1c3c8c8
...
...
@@ -815,6 +815,7 @@
@ stub RtlRevertMemoryStream
@ stub RtlRunDecodeUnicodeString
@ stub RtlRunEncodeUnicodeString
@ stdcall RtlRunOnceInitialize(ptr)
@ stdcall RtlSecondsSince1970ToTime(long ptr)
@ stdcall RtlSecondsSince1980ToTime(long ptr)
# @ stub RtlSeekMemoryStream
...
...
dlls/ntdll/sync.c
View file @
b1c3c8c8
...
...
@@ -1463,3 +1463,8 @@ NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue,
SERVER_END_REQ
;
return
status
;
}
VOID
NTAPI
RtlRunOnceInitialize
(
PRTL_RUN_ONCE
initonce
)
{
initonce
->
Ptr
=
NULL
;
}
include/winbase.h
View file @
b1c3c8c8
...
...
@@ -1316,6 +1316,12 @@ typedef struct _WIN32_STREAM_ID {
#define LOGON_NETCREDENTIALS_ONLY 0x00000002
#define LOGON_ZERO_PASSWORD_BUFFER 0x80000000
/* one-time initialisation API */
typedef
RTL_RUN_ONCE
INIT_ONCE
;
typedef
PRTL_RUN_ONCE
PINIT_ONCE
;
typedef
PRTL_RUN_ONCE
LPINIT_ONCE
;
#define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT
WINBASEAPI
BOOL
WINAPI
ActivateActCtx
(
HANDLE
,
ULONG_PTR
*
);
WINADVAPI
BOOL
WINAPI
AddAccessAllowedAce
(
PACL
,
DWORD
,
DWORD
,
PSID
);
WINADVAPI
BOOL
WINAPI
AddAccessAllowedAceEx
(
PACL
,
DWORD
,
DWORD
,
DWORD
,
PSID
);
...
...
@@ -1876,6 +1882,7 @@ WINADVAPI BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,
WINADVAPI
BOOL
WINAPI
InitializeSid
(
PSID
,
PSID_IDENTIFIER_AUTHORITY
,
BYTE
);
WINBASEAPI
VOID
WINAPI
InitializeSListHead
(
PSLIST_HEADER
);
WINBASEAPI
VOID
WINAPI
InitializeSRWLock
(
PSRWLOCK
);
WINBASEAPI
VOID
WINAPI
InitOnceInitialize
(
PINIT_ONCE
);
WINBASEAPI
PSLIST_ENTRY
WINAPI
InterlockedFlushSList
(
PSLIST_HEADER
);
WINBASEAPI
PSLIST_ENTRY
WINAPI
InterlockedPopEntrySList
(
PSLIST_HEADER
);
WINBASEAPI
PSLIST_ENTRY
WINAPI
InterlockedPushEntrySList
(
PSLIST_HEADER
,
PSLIST_ENTRY
);
...
...
include/winnt.h
View file @
b1c3c8c8
...
...
@@ -5087,6 +5087,13 @@ typedef struct _RTL_SRWLOCK {
typedef
VOID
(
NTAPI
*
WAITORTIMERCALLBACKFUNC
)
(
PVOID
,
BOOLEAN
);
typedef
VOID
(
NTAPI
*
PFLS_CALLBACK_FUNCTION
)
(
PVOID
);
#define RTL_RUN_ONCE_INIT {0}
typedef
union
_RTL_RUN_ONCE
{
PVOID
Ptr
;
}
RTL_RUN_ONCE
,
*
PRTL_RUN_ONCE
;
NTSYSAPI
VOID
NTAPI
RtlRunOnceInitialize
(
PRTL_RUN_ONCE
);
#include <pshpack8.h>
typedef
struct
_IO_COUNTERS
{
ULONGLONG
DECLSPEC_ALIGN
(
8
)
ReadOperationCount
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment