[KERNEL32]
authorJérôme Gardou <jerome.gardou@reactos.org>
Thu, 25 Sep 2014 18:25:47 +0000 (18:25 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Thu, 25 Sep 2014 18:25:47 +0000 (18:25 +0000)
 - Introduce kernel32_vista.dll, aiming at adding implementation of vista+ routines (for wine modules) without screwing kernel32 export list.
[MSI][PDH][SNMPAPI]
 - Link to kernel32_vista

svn path=/trunk/; revision=64282

reactos/dll/win32/CMakeLists.txt
reactos/dll/win32/kernel32_vista/CMakeLists.txt [new file with mode: 0644]
reactos/dll/win32/kernel32_vista/DllMain.c [new file with mode: 0644]
reactos/dll/win32/kernel32_vista/GetTickCount64.c [new file with mode: 0644]
reactos/dll/win32/kernel32_vista/k32_vista.h [new file with mode: 0644]
reactos/dll/win32/kernel32_vista/kernel32_vista.spec [new file with mode: 0644]
reactos/dll/win32/msi/CMakeLists.txt
reactos/dll/win32/pdh/CMakeLists.txt
reactos/dll/win32/snmpapi/CMakeLists.txt

index 833f688..fc01a8d 100644 (file)
@@ -71,6 +71,7 @@ add_subdirectory(itss)
 add_subdirectory(jscript)
 add_subdirectory(jsproxy)
 add_subdirectory(kernel32)
+add_subdirectory(kernel32_vista)
 add_subdirectory(loadperf)
 add_subdirectory(localspl)
 add_subdirectory(localui)
diff --git a/reactos/dll/win32/kernel32_vista/CMakeLists.txt b/reactos/dll/win32/kernel32_vista/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0e2e280
--- /dev/null
@@ -0,0 +1,24 @@
+
+add_definitions(-D_KERNEL32_)
+
+remove_definitions(-D_WIN32_WINNT=0x502)
+add_definitions(-D_WIN32_WINNT=0x600)
+
+spec2def(kernel32_vista.dll kernel32_vista.spec ADD_IMPORTLIB)
+
+list(APPEND SOURCE
+    DllMain.c
+    GetTickCount64.c
+)
+
+add_library(kernel32_vista SHARED
+    ${SOURCE}
+    ${CMAKE_CURRENT_BINARY_DIR}/kernel32_vista.def
+)
+
+set_module_type(kernel32_vista win32dll HOTPATCHABLE ENTRYPOINT DllMain 12)
+
+add_importlibs(kernel32_vista kernel32)
+
+add_dependencies(kernel32_vista psdk)
+add_cd_file(TARGET kernel32_vista DESTINATION reactos/system32 FOR all)
diff --git a/reactos/dll/win32/kernel32_vista/DllMain.c b/reactos/dll/win32/kernel32_vista/DllMain.c
new file mode 100644 (file)
index 0000000..cf94f57
--- /dev/null
@@ -0,0 +1,14 @@
+
+#include "k32_vista.h"
+
+BOOL
+WINAPI
+DllMain(HANDLE hDll,
+        DWORD dwReason,
+        LPVOID lpReserved)
+{
+    /* For now, there isn't much to do */
+    if (dwReason == DLL_PROCESS_ATTACH)
+        DisableThreadLibraryCalls(hDll);
+    return TRUE;
+}
diff --git a/reactos/dll/win32/kernel32_vista/GetTickCount64.c b/reactos/dll/win32/kernel32_vista/GetTickCount64.c
new file mode 100644 (file)
index 0000000..4d39535
--- /dev/null
@@ -0,0 +1,25 @@
+
+#include "k32_vista.h"
+
+/*
+ * @implemented
+ */
+ULONGLONG
+WINAPI
+GetTickCount64(VOID)
+{
+    ULARGE_INTEGER TickCount;
+
+    while (TRUE)
+    {
+        TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
+        TickCount.LowPart = SharedUserData->TickCount.LowPart;
+
+        if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time) break;
+
+        YieldProcessor();
+     }
+
+     return (UInt32x32To64(TickCount.LowPart, SharedUserData->TickCountMultiplier) >> 24) +
+            (UInt32x32To64(TickCount.HighPart, SharedUserData->TickCountMultiplier) << 8);
+}
diff --git a/reactos/dll/win32/kernel32_vista/k32_vista.h b/reactos/dll/win32/kernel32_vista/k32_vista.h
new file mode 100644 (file)
index 0000000..45c8bfe
--- /dev/null
@@ -0,0 +1,11 @@
+
+#pragma once
+
+/* PSDK/NDK Headers */
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+
+#include <ndk/kefuncs.h>
+#include <ndk/psfuncs.h>
+
diff --git a/reactos/dll/win32/kernel32_vista/kernel32_vista.spec b/reactos/dll/win32/kernel32_vista/kernel32_vista.spec
new file mode 100644 (file)
index 0000000..33f49cb
--- /dev/null
@@ -0,0 +1,2 @@
+
+@ stdcall -ret64 GetTickCount64(void)
index c075bfd..3f7c9a7 100644 (file)
@@ -83,6 +83,7 @@ add_importlibs(msi
 #fixme : should be in delayed imports
     imagehlp
     msvcrt
+    kernel32_vista
     kernel32
     ntdll)
 
index c33bfc1..07d5650 100644 (file)
@@ -14,5 +14,5 @@ list(APPEND SOURCE
 add_library(pdh SHARED ${SOURCE})
 set_module_type(pdh win32dll)
 target_link_libraries(pdh wine)
-add_importlibs(pdh msvcrt kernel32 ntdll)
+add_importlibs(pdh msvcrt kernel32_vista kernel32 ntdll)
 add_cd_file(TARGET pdh DESTINATION reactos/system32 FOR all)
index 7a5fa8b..58ef561 100644 (file)
@@ -14,5 +14,5 @@ list(APPEND SOURCE
 add_library(snmpapi SHARED ${SOURCE} snmpapi.rc)
 set_module_type(snmpapi win32dll)
 target_link_libraries(snmpapi wine)
-add_importlibs(snmpapi msvcrt kernel32 ntdll)
+add_importlibs(snmpapi msvcrt kernel32_vista kernel32 ntdll)
 add_cd_file(TARGET snmpapi DESTINATION reactos/system32 FOR all)