https://git.reactos.org/?p=reactos.git;a=commitdiff;h=70b6658af86266b6ea803…
commit 70b6658af86266b6ea803990aca3d57a571cbe11
Author: Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua>
AuthorDate: Sun Apr 26 22:15:21 2020 +0300
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Apr 26 21:15:21 2020 +0200
[PROFMAP] Initial implementation (#2119)
Co-Authored-By: Stanislav Motylkov <x86corez(a)gmail.com>
---
dll/win32/CMakeLists.txt | 1 +
dll/win32/profmap/CMakeLists.txt | 13 +++++++
dll/win32/profmap/profmap.c | 77 ++++++++++++++++++++++++++++++++++++++++
dll/win32/profmap/profmap.rc | 5 +++
dll/win32/profmap/profmap.spec | 6 ++++
5 files changed, 102 insertions(+)
diff --git a/dll/win32/CMakeLists.txt b/dll/win32/CMakeLists.txt
index d8ecf5ca50f..e69b50bc877 100644
--- a/dll/win32/CMakeLists.txt
+++ b/dll/win32/CMakeLists.txt
@@ -158,6 +158,7 @@ add_subdirectory(pdh)
add_subdirectory(pidgen)
add_subdirectory(powrprof)
add_subdirectory(printui)
+add_subdirectory(profmap)
add_subdirectory(propsys)
add_subdirectory(psapi)
add_subdirectory(pstorec)
diff --git a/dll/win32/profmap/CMakeLists.txt b/dll/win32/profmap/CMakeLists.txt
new file mode 100644
index 00000000000..03c350c0330
--- /dev/null
+++ b/dll/win32/profmap/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+spec2def(profmap.dll profmap.spec)
+
+list(APPEND SOURCE
+ profmap.c
+ profmap.rc
+ ${CMAKE_CURRENT_BINARY_DIR}/profmap_stubs.c
+ ${CMAKE_CURRENT_BINARY_DIR}/profmap.def)
+
+add_library(profmap MODULE ${SOURCE})
+set_module_type(profmap win32dll)
+add_importlibs(profmap msvcrt kernel32 ntdll)
+add_cd_file(TARGET profmap DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/profmap/profmap.c b/dll/win32/profmap/profmap.c
new file mode 100644
index 00000000000..a9a75946a4f
--- /dev/null
+++ b/dll/win32/profmap/profmap.c
@@ -0,0 +1,77 @@
+/*
+ * PROJECT: ReactOS system libraries
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * FILE: dll/win32/profmap/profmap.c
+ * PURPOSE: ReactOS User Profile Mapping API
+ * COPYRIGHT: Copyright 2019 Oleg Dubinskiy (oleg.dubinskij2013(a)yandex.ua)
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include <windef.h>
+#include <winbase.h>
+
+#define NDEBUG
+#include <debug.h>
+
+/* PUBLIC FUNCTIONS ***********************************************************/
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+DllMain(HINSTANCE hinstDll,
+ DWORD dwReason,
+ LPVOID reserved)
+{
+ switch (dwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinstDll);
+ break;
+
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @unimplemented
+ *
+ * NOTES:
+ * Based on the documentation from:
+ *
http://sendmail2.blogspot.com/2012/11/windows-small-business-server-2008_75…
+ */
+BOOL
+WINAPI
+RemapAndMoveUserA(IN LPCSTR pComputer,
+ IN DWORD dwFlags,
+ IN LPCSTR pCurrentUser,
+ IN LPCSTR pNewUser)
+{
+ UNIMPLEMENTED;
+ return FALSE;
+}
+
+/*
+ * @unimplemented
+ *
+ * NOTES:
+ * Based on the documentation from:
+ *
http://sendmail2.blogspot.com/2012/11/windows-small-business-server-2008_75…
+ */
+BOOL
+WINAPI
+RemapAndMoveUserW(IN LPCWSTR pComputer,
+ IN DWORD dwFlags,
+ IN LPCWSTR pCurrentUser,
+ IN LPCWSTR pNewUser)
+{
+ UNIMPLEMENTED;
+ return FALSE;
+}
+
+/* EOF */
diff --git a/dll/win32/profmap/profmap.rc b/dll/win32/profmap/profmap.rc
new file mode 100644
index 00000000000..abbb3ca5283
--- /dev/null
+++ b/dll/win32/profmap/profmap.rc
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "ReactOS User Profile Mapping API"
+#define REACTOS_STR_INTERNAL_NAME "profmap"
+#define REACTOS_STR_ORIGINAL_FILENAME "profmap.dll"
+#include <reactos/version.rc>
diff --git a/dll/win32/profmap/profmap.spec b/dll/win32/profmap/profmap.spec
new file mode 100644
index 00000000000..d4039086339
--- /dev/null
+++ b/dll/win32/profmap/profmap.spec
@@ -0,0 +1,6 @@
+@ stdcall DllMain(ptr long ptr)
+@ stub InitializeProfileMappingApi
+@ stdcall RemapAndMoveUserA(str long str str)
+@ stdcall RemapAndMoveUserW(wstr long wstr wstr)
+@ stub RemapUserProfileA
+@ stub RemapUserProfileW