[CONSRV-WINSRV]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 13 Jul 2013 04:54:49 +0000 (04:54 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 13 Jul 2013 04:54:49 +0000 (04:54 +0000)
Now that the console server works fine, move it into its real place (as in Windows), that is, inside winsrv.dll, instead of hosting it in consrv.dll.

svn path=/trunk/; revision=59461

134 files changed:
reactos/boot/bootdata/hivesys.inf
reactos/dll/cpl/console/CMakeLists.txt
reactos/win32ss/CMakeLists.txt
reactos/win32ss/user/consrv/CMakeLists.txt [deleted file]
reactos/win32ss/user/consrv/consrv.rc [deleted file]
reactos/win32ss/user/consrv/consrv.spec [deleted file]
reactos/win32ss/user/winsrv/CMakeLists.txt
reactos/win32ss/user/winsrv/consrv.cmake [new file with mode: 0644]
reactos/win32ss/user/winsrv/consrv/alias.c [moved from reactos/win32ss/user/consrv/alias.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/alias.h [moved from reactos/win32ss/user/consrv/alias.h with 84% similarity]
reactos/win32ss/user/winsrv/consrv/api.h [moved from reactos/win32ss/user/consrv/api.h with 97% similarity]
reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [moved from reactos/win32ss/user/consrv/condrv/coninput.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c [moved from reactos/win32ss/user/consrv/condrv/conoutput.c with 98% similarity]
reactos/win32ss/user/winsrv/consrv/condrv/console.c [moved from reactos/win32ss/user/consrv/condrv/console.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c [moved from reactos/win32ss/user/consrv/condrv/dummyfrontend.c with 98% similarity]
reactos/win32ss/user/winsrv/consrv/condrv/graphics.c [moved from reactos/win32ss/user/consrv/condrv/graphics.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/condrv/text.c [moved from reactos/win32ss/user/consrv/condrv/text.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/coninput.c [moved from reactos/win32ss/user/consrv/coninput.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/coninput.h [moved from reactos/win32ss/user/consrv/coninput.h with 91% similarity]
reactos/win32ss/user/winsrv/consrv/conoutput.c [moved from reactos/win32ss/user/consrv/conoutput.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/conoutput.h [moved from reactos/win32ss/user/consrv/conoutput.h with 97% similarity]
reactos/win32ss/user/winsrv/consrv/console.c [moved from reactos/win32ss/user/consrv/console.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/console.h [moved from reactos/win32ss/user/consrv/console.h with 94% similarity]
reactos/win32ss/user/winsrv/consrv/consrv.h [moved from reactos/win32ss/user/consrv/consrv.h with 97% similarity]
reactos/win32ss/user/winsrv/consrv/consrv.rc [new file with mode: 0644]
reactos/win32ss/user/winsrv/consrv/frontendctl.c [moved from reactos/win32ss/user/consrv/frontendctl.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/frontends.rc [moved from reactos/win32ss/user/consrv/frontends/frontends.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/consolecpl.h [moved from reactos/win32ss/user/consrv/frontends/gui/consolecpl.h with 84% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [moved from reactos/win32ss/user/consrv/frontends/gui/graphics.c with 97% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [moved from reactos/win32ss/user/consrv/frontends/gui/guisettings.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [moved from reactos/win32ss/user/consrv/frontends/gui/guisettings.h with 98% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [moved from reactos/win32ss/user/consrv/frontends/gui/guiterm.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h [moved from reactos/win32ss/user/consrv/frontends/gui/guiterm.h with 92% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.rc [moved from reactos/win32ss/user/consrv/frontends/gui/guiterm.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/bg-BG.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/bg-BG.rc with 94% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/cs-CZ.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/cs-CZ.rc with 93% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/de-DE.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/de-DE.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/el-GR.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/el-GR.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/en-US.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/en-US.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/es-ES.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/es-ES.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/fr-FR.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/fr-FR.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/he-IL.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/he-IL.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/id-ID.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/id-ID.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/it-IT.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/it-IT.rc with 94% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/ja-JP.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/ja-JP.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/no-NO.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/no-NO.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/pl-PL.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/pl-PL.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/pt-BR.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/pt-BR.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/ro-RO.rc with 93% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/ru-RU.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/ru-RU.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/sk-SK.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/sk-SK.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/sv-SE.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/sv-SE.rc with 93% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/tr-TR.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/tr-TR.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/uk-UA.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/uk-UA.rc with 95% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/zh-CN.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-TW.rc [moved from reactos/win32ss/user/consrv/frontends/gui/lang/zh-TW.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/res/terminal.ico [moved from reactos/win32ss/user/consrv/frontends/gui/res/terminal.ico with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/resource.h [moved from reactos/win32ss/user/consrv/frontends/gui/resource.h with 95% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/rsrc.rc [moved from reactos/win32ss/user/consrv/frontends/gui/rsrc.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [moved from reactos/win32ss/user/consrv/frontends/gui/text.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/input.c [moved from reactos/win32ss/user/consrv/frontends/input.c with 97% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [moved from reactos/win32ss/user/consrv/frontends/tui/tuiterm.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h [moved from reactos/win32ss/user/consrv/frontends/tui/tuiterm.h with 89% similarity]
reactos/win32ss/user/winsrv/consrv/handle.c [moved from reactos/win32ss/user/consrv/handle.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/handle.h [moved from reactos/win32ss/user/consrv/handle.h with 96% similarity]
reactos/win32ss/user/winsrv/consrv/heap.h [moved from reactos/win32ss/user/consrv/heap.h with 89% similarity]
reactos/win32ss/user/winsrv/consrv/include/conio.h [moved from reactos/win32ss/user/consrv/include/conio.h with 99% similarity]
reactos/win32ss/user/winsrv/consrv/include/conio2.h [moved from reactos/win32ss/user/consrv/conio.h with 98% similarity]
reactos/win32ss/user/winsrv/consrv/include/console.h [moved from reactos/win32ss/user/consrv/include/console.h with 95% similarity]
reactos/win32ss/user/winsrv/consrv/include/settings.h [moved from reactos/win32ss/user/consrv/include/settings.h with 97% similarity]
reactos/win32ss/user/winsrv/consrv/init.c [moved from reactos/win32ss/user/consrv/init.c with 98% similarity]
reactos/win32ss/user/winsrv/consrv/lang/bg-BG.rc [moved from reactos/win32ss/user/consrv/lang/bg-BG.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/cs-CZ.rc [moved from reactos/win32ss/user/consrv/lang/cs-CZ.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/de-DE.rc [moved from reactos/win32ss/user/consrv/lang/de-DE.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/el-GR.rc [moved from reactos/win32ss/user/consrv/lang/el-GR.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/en-US.rc [moved from reactos/win32ss/user/consrv/lang/en-US.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/es-ES.rc [moved from reactos/win32ss/user/consrv/lang/es-ES.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/fr-FR.rc [moved from reactos/win32ss/user/consrv/lang/fr-FR.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/he-IL.rc [moved from reactos/win32ss/user/consrv/lang/he-IL.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/id-ID.rc [moved from reactos/win32ss/user/consrv/lang/id-ID.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/it-IT.rc [moved from reactos/win32ss/user/consrv/lang/it-IT.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/ja-JP.rc [moved from reactos/win32ss/user/consrv/lang/ja-JP.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/no-NO.rc [moved from reactos/win32ss/user/consrv/lang/no-NO.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/pl-PL.rc [moved from reactos/win32ss/user/consrv/lang/pl-PL.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/pt-BR.rc [moved from reactos/win32ss/user/consrv/lang/pt-BR.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/ro-RO.rc [moved from reactos/win32ss/user/consrv/lang/ro-RO.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/ru-RU.rc [moved from reactos/win32ss/user/consrv/lang/ru-RU.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/sk-SK.rc [moved from reactos/win32ss/user/consrv/lang/sk-SK.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/sv-SE.rc [moved from reactos/win32ss/user/consrv/lang/sv-SE.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/tr-TR.rc [moved from reactos/win32ss/user/consrv/lang/tr-TR.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/uk-UA.rc [moved from reactos/win32ss/user/consrv/lang/uk-UA.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/zh-CN.rc [moved from reactos/win32ss/user/consrv/lang/zh-CN.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lang/zh-TW.rc [moved from reactos/win32ss/user/consrv/lang/zh-TW.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/lineinput.c [moved from reactos/win32ss/user/consrv/lineinput.c with 99% similarity]
reactos/win32ss/user/winsrv/consrv/lineinput.h [moved from reactos/win32ss/user/consrv/lineinput.h with 85% similarity]
reactos/win32ss/user/winsrv/consrv/procinit.h [moved from reactos/win32ss/user/consrv/procinit.h with 94% similarity]
reactos/win32ss/user/winsrv/consrv/resource.h [moved from reactos/win32ss/user/consrv/resource.h with 78% similarity]
reactos/win32ss/user/winsrv/consrv/rsrc.rc [moved from reactos/win32ss/user/consrv/rsrc.rc with 100% similarity]
reactos/win32ss/user/winsrv/consrv/settings.c [moved from reactos/win32ss/user/consrv/settings.c with 99% similarity]
reactos/win32ss/user/winsrv/init.c
reactos/win32ss/user/winsrv/usersrv.cmake [new file with mode: 0644]
reactos/win32ss/user/winsrv/usersrv/api.h [moved from reactos/win32ss/user/winsrv/api.h with 91% similarity]
reactos/win32ss/user/winsrv/usersrv/harderror.c [moved from reactos/win32ss/user/winsrv/harderror.c with 99% similarity]
reactos/win32ss/user/winsrv/usersrv/init.c [new file with mode: 0644]
reactos/win32ss/user/winsrv/usersrv/lang/bg-BG.rc [moved from reactos/win32ss/user/winsrv/lang/bg-BG.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/cs-CZ.rc [moved from reactos/win32ss/user/winsrv/lang/cs-CZ.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/de-DE.rc [moved from reactos/win32ss/user/winsrv/lang/de-DE.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/el-GR.rc [moved from reactos/win32ss/user/winsrv/lang/el-GR.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/en-US.rc [moved from reactos/win32ss/user/winsrv/lang/en-US.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/es-ES.rc [moved from reactos/win32ss/user/winsrv/lang/es-ES.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/fr-FR.rc [moved from reactos/win32ss/user/winsrv/lang/fr-FR.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/he-IL.rc [moved from reactos/win32ss/user/winsrv/lang/he-IL.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/id-ID.rc [moved from reactos/win32ss/user/winsrv/lang/id-ID.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/it-IT.rc [moved from reactos/win32ss/user/winsrv/lang/it-IT.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/ja-JP.rc [moved from reactos/win32ss/user/winsrv/lang/ja-JP.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/no-NO.rc [moved from reactos/win32ss/user/winsrv/lang/no-NO.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/pl-PL.rc [moved from reactos/win32ss/user/winsrv/lang/pl-PL.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/pt-BR.rc [moved from reactos/win32ss/user/winsrv/lang/pt-BR.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/ro-RO.rc [moved from reactos/win32ss/user/winsrv/lang/ro-RO.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/ru-RU.rc [moved from reactos/win32ss/user/winsrv/lang/ru-RU.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/sk-SK.rc [moved from reactos/win32ss/user/winsrv/lang/sk-SK.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/sv-SE.rc [moved from reactos/win32ss/user/winsrv/lang/sv-SE.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/tr-TR.rc [moved from reactos/win32ss/user/winsrv/lang/tr-TR.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/uk-UA.rc [moved from reactos/win32ss/user/winsrv/lang/uk-UA.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/zh-CN.rc [moved from reactos/win32ss/user/winsrv/lang/zh-CN.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/lang/zh-TW.rc [moved from reactos/win32ss/user/winsrv/lang/zh-TW.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/register.c [moved from reactos/win32ss/user/winsrv/register.c with 96% similarity]
reactos/win32ss/user/winsrv/usersrv/resource.h [moved from reactos/win32ss/user/winsrv/resource.h with 86% similarity]
reactos/win32ss/user/winsrv/usersrv/rsrc.rc [moved from reactos/win32ss/user/winsrv/rsrc.rc with 100% similarity]
reactos/win32ss/user/winsrv/usersrv/shutdown.c [moved from reactos/win32ss/user/winsrv/shutdown.c with 99% similarity]
reactos/win32ss/user/winsrv/usersrv/usersrv.h [moved from reactos/win32ss/user/winsrv/winsrv.h with 89% similarity]
reactos/win32ss/user/winsrv/usersrv/usersrv.rc [new file with mode: 0644]
reactos/win32ss/user/winsrv/winsrv.rc
reactos/win32ss/user/winsrv/winsrv.spec

index d13c18a..b027a70 100644 (file)
@@ -1248,7 +1248,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Kmode",0x000
 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Optional",0x00010000,"Posix"
 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Posix",0x00020000,"%SystemRoot%\system32\psxss.exe"
 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Required",0x00010000,"Debug","Windows"
-HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Windows",0x00020000,"%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,12288,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=consrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16"
+HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Windows",0x00020000,"%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,12288,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16"
 
 ; WOW Support
 HKLM,"SYSTEM\CurrentControlSet\Control\Wow","",0x00000000,""
index 063a1bf..303dc2a 100644 (file)
@@ -1,7 +1,7 @@
 
 include_directories(
-    ${REACTOS_SOURCE_DIR}/win32ss/user/consrv
-    ${REACTOS_SOURCE_DIR}/win32ss/user/consrv/frontends/gui)
+    ${REACTOS_SOURCE_DIR}/win32ss/user/winsrv/consrv
+    ${REACTOS_SOURCE_DIR}/win32ss/user/winsrv/consrv/frontends/gui)
 
 spec2def(console.dll console.spec)
 
index 30110dd..e0a8321 100644 (file)
@@ -17,7 +17,6 @@ endif()
 
 add_subdirectory(gdi/gdi32)
 add_subdirectory(reactx)
-add_subdirectory(user/consrv)
 add_subdirectory(user/user32)
 add_subdirectory(user/winsrv)
 
diff --git a/reactos/win32ss/user/consrv/CMakeLists.txt b/reactos/win32ss/user/consrv/CMakeLists.txt
deleted file mode 100644 (file)
index 01d959a..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-
-remove_definitions(-D_WIN32_WINNT=0x502)
-add_definitions(-D_WIN32_WINNT=0x600)
-
-include_directories(
-    ${REACTOS_SOURCE_DIR}/include/reactos/subsys
-    ${REACTOS_SOURCE_DIR}/win32ss/include)
-
-spec2def(consrv.dll consrv.spec)
-
-list(APPEND SOURCE
-    alias.c
-    coninput.c
-    conoutput.c
-    console.c
-    frontendctl.c
-    handle.c
-    init.c
-    lineinput.c
-    settings.c
-    condrv/coninput.c
-    condrv/conoutput.c
-    condrv/console.c
-    condrv/dummyfrontend.c
-    condrv/graphics.c
-    condrv/text.c
-    frontends/input.c
-    frontends/gui/guiterm.c
-    frontends/gui/guisettings.c
-    frontends/gui/graphics.c
-    frontends/gui/text.c
-    frontends/tui/tuiterm.c
-    ${CMAKE_CURRENT_BINARY_DIR}/consrv.def)
-
-add_library(consrv SHARED
-    ${SOURCE}
-    consrv.rc)
-
-#
-# Explicitely enable MS extensions to be able to use unnamed (anonymous) nested structs.
-#
-# FIXME: http://www.cmake.org/Bug/view.php?id=12998
-if(MSVC)
-    ## NOTE: No need to specify it as we use MSVC :)
-    ##add_target_compile_flags(consrv "/Ze")
-    #set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "/Ze")
-else()
-    #add_target_compile_flags(consrv "-fms-extensions")
-    set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-fms-extensions")
-endif()
-
-target_link_libraries(consrv win32ksys ${PSEH_LIB} uuid) # win32ksys because of NtUser...()
-
-set_module_type(consrv win32dll UNICODE)
-
-add_importlibs(consrv psapi msvcrt kernel32 ntdll csrsrv)
-add_delay_importlibs(consrv user32 gdi32 advapi32 ole32)
-
-add_dependencies(consrv bugcodes)
-add_cd_file(TARGET consrv DESTINATION reactos/system32 FOR all)
diff --git a/reactos/win32ss/user/consrv/consrv.rc b/reactos/win32ss/user/consrv/consrv.rc
deleted file mode 100644 (file)
index 6a08977..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <windef.h>
-#include <winuser.h>
-#include "resource.h"
-
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-
-#define REACTOS_VERSION_DLL
-#define REACTOS_STR_FILE_DESCRIPTION    "ReactOS Console Server & Terminal Emulator DLL"
-#define REACTOS_STR_INTERNAL_NAME       "consrv"
-#define REACTOS_STR_ORIGINAL_FILENAME   "consrv.dll"
-#include <reactos/version.rc>
-
-#include "rsrc.rc"
-
-#include "frontends/frontends.rc"
diff --git a/reactos/win32ss/user/consrv/consrv.spec b/reactos/win32ss/user/consrv/consrv.spec
deleted file mode 100644 (file)
index c883165..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@ stdcall ConServerDllInitialization(ptr)
index e5d8659..39f5deb 100644 (file)
@@ -5,16 +5,19 @@ include_directories(
 
 spec2def(winsrv.dll winsrv.spec)
 
+# The components
+include(consrv.cmake)
+include(usersrv.cmake)
+
 list(APPEND SOURCE
-    harderror.c
     init.c
-    register.c
-    shutdown.c
     winsrv.rc
     ${CMAKE_CURRENT_BINARY_DIR}/winsrv.def)
 
 add_library(winsrv SHARED ${SOURCE})
 
+# Add the components
+target_link_libraries(winsrv consrv usersrv)
 target_link_libraries(winsrv win32ksys ${PSEH_LIB}) # win32ksys because of NtUser...()
 
 set_module_type(winsrv win32dll UNICODE)
diff --git a/reactos/win32ss/user/winsrv/consrv.cmake b/reactos/win32ss/user/winsrv/consrv.cmake
new file mode 100644 (file)
index 0000000..faa44c6
--- /dev/null
@@ -0,0 +1,52 @@
+
+remove_definitions(-D_WIN32_WINNT=0x502)
+add_definitions(-D_WIN32_WINNT=0x600)
+
+include_directories(consrv)
+
+list(APPEND CONSRV_SOURCE
+    consrv/alias.c
+    consrv/coninput.c
+    consrv/conoutput.c
+    consrv/console.c
+    consrv/frontendctl.c
+    consrv/handle.c
+    consrv/init.c
+    consrv/lineinput.c
+    consrv/settings.c
+    consrv/condrv/coninput.c
+    consrv/condrv/conoutput.c
+    consrv/condrv/console.c
+    consrv/condrv/dummyfrontend.c
+    consrv/condrv/graphics.c
+    consrv/condrv/text.c
+    consrv/frontends/input.c
+    consrv/frontends/gui/guiterm.c
+    consrv/frontends/gui/guisettings.c
+    consrv/frontends/gui/graphics.c
+    consrv/frontends/gui/text.c
+    consrv/frontends/tui/tuiterm.c
+    # consrv/consrv.rc
+    )
+
+#
+# Explicitely enable MS extensions to be able to use unnamed (anonymous) nested structs.
+#
+# FIXME: http://www.cmake.org/Bug/view.php?id=12998
+if(MSVC)
+    ## NOTE: No need to specify it as we use MSVC :)
+    ##add_target_compile_flags(consrv "/Ze")
+    #set_source_files_properties(${CONSRV_SOURCE} PROPERTIES COMPILE_FLAGS "/Ze")
+else()
+    #add_target_compile_flags(consrv "-fms-extensions")
+    set_source_files_properties(${CONSRV_SOURCE} PROPERTIES COMPILE_FLAGS "-fms-extensions")
+endif()
+
+add_library(consrv ${CONSRV_SOURCE})
+#add_object_library(consrv ${CONSRV_SOURCE})
+
+add_importlibs(consrv psapi)         # And the default ones from winsrv
+add_delay_importlibs(consrv ole32)   # And the default ones from winsrv
+target_link_libraries(consrv uuid)   # And the default ones from winsrv
+
+set_module_type(consrv module UNICODE)
similarity index 99%
rename from reactos/win32ss/user/consrv/alias.c
rename to reactos/win32ss/user/winsrv/consrv/alias.c
index 1ab7b07..d96ab0a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * LICENSE:         GPL - See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/alias.c
+ * FILE:            win32ss/user/winsrv/consrv/alias.c
  * PURPOSE:         Alias support functions
  * PROGRAMMERS:     Christoph Wittich
  *                  Johannes Anderwald
similarity index 84%
rename from reactos/win32ss/user/consrv/alias.h
rename to reactos/win32ss/user/winsrv/consrv/alias.h
index cc501d9..19e3b98 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * LICENSE:         GPL - See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/alias.h
+ * FILE:            win32ss/user/winsrv/consrv/alias.h
  * PURPOSE:         Alias support functions
  * PROGRAMMERS:     Christoph Wittich
  *                  Johannes Anderwald
similarity index 97%
rename from reactos/win32ss/user/consrv/api.h
rename to reactos/win32ss/user/winsrv/consrv/api.h
index d2f6db5..a7f340b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/api.h
+ * FILE:            win32ss/user/winsrv/consrv/api.h
  * PURPOSE:         Public server APIs definitions
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Driver DLL
- * FILE:            win32ss/user/consrv/condrv/coninput.c
+ * FILE:            win32ss/user/winsrv/consrv/condrv/coninput.c
  * PURPOSE:         Console Input functions
  * PROGRAMMERS:     Jeffrey Morlan
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -11,7 +11,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "handle.h"
 #include "lineinput.h"
 
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Driver DLL
- * FILE:            win32ss/user/consrv/condrv/conoutput.c
+ * FILE:            win32ss/user/winsrv/consrv/condrv/conoutput.c
  * PURPOSE:         General Console Output Functions
  * PROGRAMMERS:     Jeffrey Morlan
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -12,7 +12,7 @@
 #include "consrv.h"
 #include "console.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "conoutput.h"
 #include "handle.h"
 
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Driver DLL
- * FILE:            win32ss/user/consrv/condrv/console.c
+ * FILE:            win32ss/user/winsrv/consrv/condrv/console.c
  * PURPOSE:         Console Management Functions
  * PROGRAMMERS:     Gé van Geldorp
  *                  Jeffrey Morlan
@@ -12,7 +12,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "handle.h"
 #include "procinit.h"
 #include "alias.h"
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/condrv/dummyfrontend.c
+ * FILE:            win32ss/user/winsrv/consrv/condrv/dummyfrontend.c
  * PURPOSE:         Dummy Terminal Front-End used when no frontend
  *                  is attached to the specified console.
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Driver DLL
- * FILE:            win32ss/user/consrv/condrv/graphics.c
+ * FILE:            win32ss/user/winsrv/consrv/condrv/graphics.c
  * PURPOSE:         Console Output Functions for graphics-mode screen-buffers
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  *
@@ -13,7 +13,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "conoutput.h"
 #include "handle.h"
 
similarity index 99%
rename from reactos/win32ss/user/consrv/condrv/text.c
rename to reactos/win32ss/user/winsrv/consrv/condrv/text.c
index 287a141..f6b3b50 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Driver DLL
- * FILE:            win32ss/user/consrv/condrv/text.c
+ * FILE:            win32ss/user/winsrv/consrv/condrv/text.c
  * PURPOSE:         Console Output Functions for text-mode screen-buffers
  * PROGRAMMERS:     Jeffrey Morlan
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -11,7 +11,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "conoutput.h"
 #include "handle.h"
 
similarity index 99%
rename from reactos/win32ss/user/consrv/coninput.c
rename to reactos/win32ss/user/winsrv/consrv/coninput.c
index a26b5b1..7143a32 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/coninput.c
+ * FILE:            win32ss/user/winsrv/consrv/coninput.c
  * PURPOSE:         Console Input functions
  * PROGRAMMERS:     Jeffrey Morlan
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -11,7 +11,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "handle.h"
 #include "lineinput.h"
 
similarity index 91%
rename from reactos/win32ss/user/consrv/coninput.h
rename to reactos/win32ss/user/winsrv/consrv/coninput.h
index b7ac14e..43e4f54 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/coninput.h
+ * FILE:            win32ss/user/winsrv/consrv/coninput.h
  * PURPOSE:         Console Input functions
  * PROGRAMMERS:     Jeffrey Morlan
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
similarity index 99%
rename from reactos/win32ss/user/consrv/conoutput.c
rename to reactos/win32ss/user/winsrv/consrv/conoutput.c
index 95e29f7..223f6ca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/conoutput.c
+ * FILE:            win32ss/user/winsrv/consrv/conoutput.c
  * PURPOSE:         General Console Output Functions
  * PROGRAMMERS:     Jeffrey Morlan
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -12,7 +12,7 @@
 #include "consrv.h"
 #include "console.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "conoutput.h"
 #include "handle.h"
 
similarity index 97%
rename from reactos/win32ss/user/consrv/conoutput.h
rename to reactos/win32ss/user/winsrv/consrv/conoutput.h
index 1bd1d2f..966a6ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/conoutput.h
+ * FILE:            win32ss/user/winsrv/consrv/conoutput.h
  * PURPOSE:         Console Output functions
  * PROGRAMMERS:     Jeffrey Morlan
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
similarity index 99%
rename from reactos/win32ss/user/consrv/console.c
rename to reactos/win32ss/user/winsrv/consrv/console.c
index e1a6940..9403daa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/console.c
+ * FILE:            win32ss/user/winsrv/consrv/console.c
  * PURPOSE:         Console Management Functions
  * PROGRAMMERS:     Gé van Geldorp
  *                  Jeffrey Morlan
@@ -12,7 +12,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "handle.h"
 #include "procinit.h"
 #include "alias.h"
similarity index 94%
rename from reactos/win32ss/user/consrv/console.h
rename to reactos/win32ss/user/winsrv/consrv/console.h
index e56a10d..b617da8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/console.h
+ * FILE:            win32ss/user/winsrv/consrv/console.h
  * PURPOSE:         Console Initialization Functions
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
similarity index 97%
rename from reactos/win32ss/user/consrv/consrv.h
rename to reactos/win32ss/user/winsrv/consrv/consrv.h
index ef65958..7a07e3b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/consrv.h
+ * FILE:            win32ss/user/winsrv/consrv/consrv.h
  * PURPOSE:         Main header - Definitions
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
diff --git a/reactos/win32ss/user/winsrv/consrv/consrv.rc b/reactos/win32ss/user/winsrv/consrv/consrv.rc
new file mode 100644 (file)
index 0000000..3e64798
--- /dev/null
@@ -0,0 +1,6 @@
+#include <windef.h>
+#include <winuser.h>
+#include "resource.h"
+
+#include "rsrc.rc"
+#include "frontends/frontends.rc"
similarity index 99%
rename from reactos/win32ss/user/consrv/frontendctl.c
rename to reactos/win32ss/user/winsrv/consrv/frontendctl.c
index d878154..92c147a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontendctl.c
+ * FILE:            win32ss/user/winsrv/consrv/frontendctl.c
  * PURPOSE:         Terminal Front-Ends Control
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
@@ -10,7 +10,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "conoutput.h"
 #include "console.h"
 #include "handle.h"
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/consolecpl.h
+ * FILE:            win32ss/user/winsrv/consrv/consolecpl.h
  * PURPOSE:         GUI front-end settings management - Header for console.dll
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontends/gui/graphics.c
+ * FILE:            win32ss/user/winsrv/consrv/frontends/gui/graphics.c
  * PURPOSE:         GUI Terminal Front-End - Support for graphics-mode screen-buffers
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontends/gui/guisettings.c
+ * FILE:            win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
  * PURPOSE:         GUI Terminal Front-End Settings Management
  * PROGRAMMERS:     Johannes Anderwald
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/guisettings.h
+ * FILE:            win32ss/user/winsrv/consrv/guisettings.h
  * PURPOSE:         GUI front-end settings management
  * PROGRAMMERS:     Johannes Anderwald
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontends/gui/guiterm.c
+ * FILE:            win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
  * PURPOSE:         GUI Terminal Front-End
  * PROGRAMMERS:     Gé van Geldorp
  *                  Johannes Anderwald
 
 
 /* Not defined in any header file */
-// extern VOID WINAPI PrivateCsrssManualGuiCheck(LONG Check);
-// From win32ss/user/win32csr/dllmain.c
-VOID
-WINAPI
-PrivateCsrssManualGuiCheck(LONG Check)
-{
-    NtUserCallOneParam(Check, ONEPARAM_ROUTINE_CSRSS_GUICHECK);
-}
+extern VOID WINAPI PrivateCsrssManualGuiCheck(LONG Check);
+// See winsrv/usersrv/init.c line 234
+
 
 /* GLOBALS ********************************************************************/
 
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontends/gui/guiterm.h
+ * FILE:            win32ss/user/winsrv/consrv/frontends/gui/guiterm.h
  * PURPOSE:         GUI Terminal Front-End
  * PROGRAMMERS:     Gé van Geldorp
  *                  Johannes Anderwald
@@ -1,6 +1,6 @@
 /*
  * PROJECT:         ReactOS CSRSS subsystem
- * FILE:            win32ss/user/consrv/lang/bg-BG.rc
+ * FILE:            win32ss/user/winsrv/consrv/lang/bg-BG.rc
  * PURPOSE:         Bulgarian resource file
  */
 
@@ -1,5 +1,5 @@
 /*
- * FILE:        win32ss/user/consrv/lang/cs-CZ.rc
+ * FILE:        win32ss/user/winsrv/consrv/lang/cs-CZ.rc
  * TRANSLATOR:  Radek Liska aka Black_Fox (radekliska at gmail dot com)
  * UPDATED:     2011-04-09
  */
@@ -1,7 +1,7 @@
 /*
 * PROJECT:     ReactOS Client/Server Runtime subsystem
 * LICENSE:     GPL - See COPYING in the top level directory
-* FILE:        win32ss/user/consrv/lang/it-IT.rc
+* FILE:        win32ss/user/winsrv/consrv/lang/it-IT.rc
 * PURPOSE:     Italian Translation
 * PROGRAMMERS:
 *              Copyright (C) 2007 Daniele Forsi (dforsi at gmail.com) Italian Translation
@@ -1,5 +1,5 @@
 /*
- * FILE:             win32ss/user/consrv/lang/ro-RO.rc
+ * FILE:             win32ss/user/winsrv/consrv/lang/ro-RO.rc
  *                   ReactOS Project (http://www.reactos.org)
  * TRANSLATOR:       Fulea Ștefan (PM on ReactOS Forum at fulea.stefan)
  * CHANGE LOG:       2011-10-16  initial translation
@@ -1,6 +1,6 @@
 /*
  * PROJECT:         ReactOS CSRSS subsystem
- * FILE:            win32ss/user/consrv/lang/sv-SE.rc
+ * FILE:            win32ss/user/winsrv/consrv/lang/sv-SE.rc
  * PURPOSE:         Swedish resource file
  * Translation:     Jaix Bly
  */
@@ -1,7 +1,7 @@
 /*
  * PROJECT:         ReactOS CSRSS subsystem
  * LICENSE:         GPL - See COPYING in the top level directory
- * FILE:            win32ss/user/consrv/lang/uk-UA.rc
+ * FILE:            win32ss/user/winsrv/consrv/lang/uk-UA.rc
  * PURPOSE:         Ukraianian resource file
  * TRANSLATOR:      Artem Reznikov
  */
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/resource.h
+ * FILE:            win32ss/user/winsrv/consrv/resource.h
  * PURPOSE:         Resource #defines
  */
 
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontends/gui/text.c
+ * FILE:            win32ss/user/winsrv/consrv/frontends/gui/text.c
  * PURPOSE:         GUI Terminal Front-End - Support for text-mode screen-buffers
  * PROGRAMMERS:     Gé van Geldorp
  *                  Johannes Anderwald
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontends/input.c
+ * FILE:            win32ss/user/winsrv/consrv/frontends/input.c
  * PURPOSE:         Common Front-Ends Input functions
  * PROGRAMMERS:     Jeffrey Morlan
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -11,7 +11,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "coninput.h"
 
 #define NDEBUG
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontends/tui/tuiterm.c
+ * FILE:            win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
  * PURPOSE:         TUI Terminal Front-End - Virtual Consoles...
  * PROGRAMMERS:     David Welch
  *                  Gé van Geldorp
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/frontends/tui/tuiterm.h
+ * FILE:            win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h
  * PURPOSE:         TUI Terminal Front-End
  * PROGRAMMERS:     David Welch
  *                  Gé van Geldorp
similarity index 99%
rename from reactos/win32ss/user/consrv/handle.c
rename to reactos/win32ss/user/winsrv/consrv/handle.c
index 5f2d2b7..f5ef3e7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * LICENSE:         GPL - See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/handle.c
+ * FILE:            win32ss/user/winsrv/consrv/handle.c
  * PURPOSE:         Console I/O Handles functions
  * PROGRAMMERS:     David Welch
  *                  Jeffrey Morlan
@@ -12,7 +12,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "handle.h"
 #include "include/console.h"
 #include "console.h"
similarity index 96%
rename from reactos/win32ss/user/consrv/handle.h
rename to reactos/win32ss/user/winsrv/consrv/handle.h
index c3ee1f2..dcd7b59 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * LICENSE:         GPL - See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/handle.h
+ * FILE:            win32ss/user/winsrv/consrv/handle.h
  * PURPOSE:         Console I/O Handles functions
  * PROGRAMMERS:     David Welch
  *                  Jeffrey Morlan
similarity index 89%
rename from reactos/win32ss/user/consrv/heap.h
rename to reactos/win32ss/user/winsrv/consrv/heap.h
index dd874e8..4d21c65 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/heap.h
+ * FILE:            win32ss/user/winsrv/consrv/heap.h
  * PURPOSE:         Heap Helpers
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/include/conio.h
+ * FILE:            win32ss/user/winsrv/consrv/include/conio.h
  * PURPOSE:         Public Console I/O Interface
  * PROGRAMMERS:     Gé van Geldorp
  *                  Jeffrey Morlan
similarity index 98%
rename from reactos/win32ss/user/consrv/conio.h
rename to reactos/win32ss/user/winsrv/consrv/include/conio2.h
index 17281a5..ce8efd0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/conio.h
+ * FILE:            win32ss/user/winsrv/consrv/conio.h
  * PURPOSE:         Internal Console I/O Interface
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/include/console.h
+ * FILE:            win32ss/user/winsrv/consrv/include/console.h
  * PURPOSE:         Public Console Management Interface
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/include/settings.h
+ * FILE:            win32ss/user/winsrv/consrv/include/settings.h
  * PURPOSE:         Public Console Settings Management Interface
  * PROGRAMMERS:     Johannes Anderwald
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
similarity index 98%
rename from reactos/win32ss/user/consrv/init.c
rename to reactos/win32ss/user/winsrv/consrv/init.c
index c058059..1cc32b6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/init.c
+ * FILE:            win32ss/user/winsrv/consrv/init.c
  * PURPOSE:         Initialization
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
@@ -528,16 +528,4 @@ CSR_SERVER_DLL_INIT(ConServerDllInitialization)
     return STATUS_SUCCESS;
 }
 
-BOOL
-WINAPI
-DllMain(IN HINSTANCE hInstanceDll,
-        IN DWORD dwReason,
-        IN LPVOID lpReserved)
-{
-    UNREFERENCED_PARAMETER(hInstanceDll);
-    UNREFERENCED_PARAMETER(dwReason);
-    UNREFERENCED_PARAMETER(lpReserved);
-    return TRUE;
-}
-
 /* EOF */
similarity index 99%
rename from reactos/win32ss/user/consrv/lineinput.c
rename to reactos/win32ss/user/winsrv/consrv/lineinput.c
index d780543..2f54f0e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * LICENSE:         GPL - See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/lineinput.c
+ * FILE:            win32ss/user/winsrv/consrv/lineinput.c
  * PURPOSE:         Console line input functions
  * PROGRAMMERS:     Jeffrey Morlan
  */
@@ -11,7 +11,7 @@
 #include "consrv.h"
 #include "console.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 
 #define NDEBUG
 #include <debug.h>
similarity index 85%
rename from reactos/win32ss/user/consrv/lineinput.h
rename to reactos/win32ss/user/winsrv/consrv/lineinput.h
index 555b08e..77dae2e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * LICENSE:         GPL - See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/lineinput.c
+ * FILE:            win32ss/user/winsrv/consrv/lineinput.c
  * PURPOSE:         Console line input functions
  * PROGRAMMERS:     Jeffrey Morlan
  */
similarity index 94%
rename from reactos/win32ss/user/consrv/procinit.h
rename to reactos/win32ss/user/winsrv/consrv/procinit.h
index f6f52f6..93f046d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * LICENSE:         GPL - See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/procinit.h
+ * FILE:            win32ss/user/winsrv/consrv/procinit.h
  * PURPOSE:         Functions for console processes initialization
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
similarity index 78%
rename from reactos/win32ss/user/consrv/resource.h
rename to reactos/win32ss/user/winsrv/consrv/resource.h
index 126e700..dc6f4a9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/resource.h
+ * FILE:            win32ss/user/winsrv/consrv/resource.h
  * PURPOSE:         Resource #defines
  */
 
similarity index 99%
rename from reactos/win32ss/user/consrv/settings.c
rename to reactos/win32ss/user/winsrv/consrv/settings.c
index 468eebe..738d5bf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Console Server DLL
- * FILE:            win32ss/user/consrv/settings.c
+ * FILE:            win32ss/user/winsrv/consrv/settings.c
  * PURPOSE:         Console settings management
  * PROGRAMMERS:     Johannes Anderwald
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -11,7 +11,7 @@
 
 #include "consrv.h"
 #include "include/conio.h"
-#include "conio.h"
+#include "include/conio2.h"
 #include "include/settings.h"
 
 #include <stdio.h> // for swprintf
index c9585cd..877cdc3 100644 (file)
 
 /* INCLUDES *******************************************************************/
 
-#include "winsrv.h"
-#include "api.h"
+/* PSDK Headers */
+#include <stdarg.h>
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+#include <windef.h>
+#include <winuser.h>
 
 #define NDEBUG
 #include <debug.h>
 
-/* GLOBALS ********************************************************************/
 
-HINSTANCE UserServerDllInstance = NULL;
-
-/* Memory */
-HANDLE UserServerHeap = NULL;   // Our own heap.
-
-// Windows Server 2003 table from http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_2k3
-PCSR_API_ROUTINE UserServerApiDispatchTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
-{
-    SrvExitWindowsEx,
-    // SrvEndTask,
-    // SrvLogon,
-    SrvRegisterServicesProcess, // Not present in Win7
-    // SrvActivateDebugger,
-    // SrvGetThreadConsoleDesktop, // Not present in Win7
-    // SrvDeviceEvent,
-    SrvRegisterLogonProcess,    // Not present in Win7
-    // SrvCreateSystemThreads,
-    // SrvRecordShutdownReason,
-    // SrvCancelShutdown,              // Added in Vista
-    // SrvConsoleHandleOperation,      // Added in Win7
-    // SrvGetSetShutdownBlockReason,   // Added in Vista
-};
-
-BOOLEAN UserServerApiServerValidTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
-{
-    FALSE,   // SrvExitWindowsEx
-    // FALSE,   // SrvEndTask
-    // FALSE,   // SrvLogon
-    FALSE,   // SrvRegisterServicesProcess
-    // FALSE,   // SrvActivateDebugger
-    // TRUE,    // SrvGetThreadConsoleDesktop
-    // FALSE,   // SrvDeviceEvent
-    FALSE,   // SrvRegisterLogonProcess
-    // FALSE,   // SrvCreateSystemThreads
-    // FALSE,   // SrvRecordShutdownReason
-    // FALSE,   // SrvCancelShutdown
-    // FALSE,   // SrvConsoleHandleOperation
-    // FALSE,   // SrvGetSetShutdownBlockReason
-};
-
-PCHAR UserServerApiNameTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
-{
-    "SrvExitWindowsEx",
-    // "SrvEndTask",
-    // "SrvLogon",
-    "SrvRegisterServicesProcess",
-    // "SrvActivateDebugger",
-    // "SrvGetThreadConsoleDesktop",
-    // "SrvDeviceEvent",
-    "SrvRegisterLogonProcess",
-    // "SrvCreateSystemThreads",
-    // "SrvRecordShutdownReason",
-    // "SrvCancelShutdown",
-    // "SrvConsoleHandleOperation",
-    // "SrvGetSetShutdownBlockReason",
-};
-
-
-/* FUNCTIONS ******************************************************************/
-
-// PUSER_SOUND_SENTRY. Used in basesrv.dll
-BOOL WINAPI _UserSoundSentry(VOID)
-{
-    // TODO: Do something.
-    return TRUE;
-}
-
-ULONG
-InitializeVideoAddressSpace(VOID)
-{
-    OBJECT_ATTRIBUTES ObjectAttributes;
-    UNICODE_STRING PhysMemName = RTL_CONSTANT_STRING(L"\\Device\\PhysicalMemory");
-    NTSTATUS Status;
-    HANDLE PhysMemHandle;
-    PVOID BaseAddress;
-    LARGE_INTEGER Offset;
-    SIZE_T ViewSize;
-    CHAR IVTAndBda[1024+256];
-    
-    /* Free the 1MB pre-reserved region. In reality, ReactOS should simply support us mapping the view into the reserved area, but it doesn't. */
-    BaseAddress = 0;
-    ViewSize = 1024 * 1024;
-    Status = ZwFreeVirtualMemory(NtCurrentProcess(), 
-                                 &BaseAddress,
-                                 &ViewSize,
-                                 MEM_RELEASE);
-    if (!NT_SUCCESS(Status))
-    {
-        DPRINT1("Couldn't unmap reserved memory (%x)\n", Status);
-        return 0;
-    }
-    
-    /* Open the physical memory section */
-    InitializeObjectAttributes(&ObjectAttributes,
-                               &PhysMemName,
-                               0,
-                               NULL,
-                               NULL);
-    Status = ZwOpenSection(&PhysMemHandle,
-                           SECTION_ALL_ACCESS,
-                           &ObjectAttributes);
-    if (!NT_SUCCESS(Status))
-    {
-        DPRINT1("Couldn't open \\Device\\PhysicalMemory\n");
-        return 0;
-    }
-
-    /* Map the BIOS and device registers into the address space */
-    Offset.QuadPart = 0xa0000;
-    ViewSize = 0x100000 - 0xa0000;
-    BaseAddress = (PVOID)0xa0000;
-    Status = ZwMapViewOfSection(PhysMemHandle,
-                                NtCurrentProcess(),
-                                &BaseAddress,
-                                0,
-                                ViewSize,
-                                &Offset,
-                                &ViewSize,
-                                ViewUnmap,
-                                0,
-                                PAGE_EXECUTE_READWRITE);
-    if (!NT_SUCCESS(Status))
-    {
-        DPRINT1("Couldn't map physical memory (%x)\n", Status);
-        ZwClose(PhysMemHandle);
-        return 0;
-    }
-
-    /* Close physical memory section handle */
-    ZwClose(PhysMemHandle);
-
-    if (BaseAddress != (PVOID)0xa0000)
-    {
-        DPRINT1("Couldn't map physical memory at the right address (was %x)\n",
-                BaseAddress);
-        return 0;
-    }
-
-    /* Allocate some low memory to use for the non-BIOS
-     * parts of the v86 mode address space
-     */
-    BaseAddress = (PVOID)0x1;
-    ViewSize = 0xa0000 - 0x1000;
-    Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
-                                     &BaseAddress,
-                                     0,
-                                     &ViewSize,
-                                     MEM_RESERVE | MEM_COMMIT,
-                                     PAGE_EXECUTE_READWRITE);
-    if (!NT_SUCCESS(Status))
-    {
-        DPRINT1("Failed to allocate virtual memory (Status %x)\n", Status);
-        return 0;
-    }
-    if (BaseAddress != (PVOID)0x0)
-    {
-        DPRINT1("Failed to allocate virtual memory at right address (was %x)\n",
-                BaseAddress);
-        return 0;
-    }
-
-    /* Get the real mode IVT and BDA from the kernel */
-    Status = NtVdmControl(VdmInitialize, IVTAndBda);
-    if (!NT_SUCCESS(Status))
-    {
-        DPRINT1("NtVdmControl failed (status %x)\n", Status);
-        return 0;
-    }
-
-    /* Return success */
-    return 1;
-}
-
-/**********************************************************************
- * UserpInitVideo
- *
- * TODO: we need a virtual device for sessions other than
- * TODO: the console one
- */
-NTSTATUS
-UserpInitVideo(VOID)
-{
-    OBJECT_ATTRIBUTES ObjectAttributes;
-    UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\??\\DISPLAY1");
-    IO_STATUS_BLOCK Iosb;
-    HANDLE VideoHandle = (HANDLE) 0;
-    NTSTATUS Status = STATUS_SUCCESS;
-
-    DPRINT("CSR: %s called\n", __FUNCTION__);
-
-    InitializeVideoAddressSpace();
-
-    InitializeObjectAttributes(&ObjectAttributes,
-                               &DeviceName,
-                               0,
-                               NULL,
-                               NULL);
-    Status = NtOpenFile(&VideoHandle,
-                        FILE_ALL_ACCESS,
-                        &ObjectAttributes,
-                        &Iosb,
-                        0,
-                        0);
-    if (NT_SUCCESS(Status))
-    {
-        NtClose(VideoHandle);
-    }
-
-    return Status;
-}
-
-VOID
-WINAPI
-PrivateCsrssManualGuiCheck(LONG Check)
-{
-    NtUserCallOneParam(Check, ONEPARAM_ROUTINE_CSRSS_GUICHECK);
-}
+/* ENTRY-POINT ****************************************************************/
 
 /*** HACK from win32csr... ***/
 static HHOOK hhk = NULL;
@@ -248,65 +36,6 @@ KeyboardHookProc(int nCode,
 }
 /*** END - HACK from win32csr... ***/
 
-DWORD
-WINAPI
-CreateSystemThreads(PVOID pParam)
-{
-    NtUserCallOneParam((DWORD)pParam, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS);
-    DPRINT1("This thread should not terminate!\n");
-    return 0;
-}
-
-CSR_SERVER_DLL_INIT(UserServerDllInitialization)
-{
-/*** From win32csr... ***/
-    HANDLE ServerThread;
-    CLIENT_ID ClientId;
-    NTSTATUS Status;
-    UINT i;
-/*** END - From win32csr... ***/
-
-    /* Initialize the memory */
-    UserServerHeap = RtlGetProcessHeap();
-
-    /* Initialize the video */
-    UserpInitVideo();
-    NtUserInitialize(0, NULL, NULL);
-    PrivateCsrssManualGuiCheck(0);
-
-    /* Setup the DLL Object */
-    LoadedServerDll->ApiBase = USERSRV_FIRST_API_NUMBER;
-    LoadedServerDll->HighestApiSupported = UserpMaxApiNumber;
-    LoadedServerDll->DispatchTable = UserServerApiDispatchTable;
-    LoadedServerDll->ValidTable = UserServerApiServerValidTable;
-    LoadedServerDll->NameTable = UserServerApiNameTable;
-    LoadedServerDll->SizeOfProcessData = 0;
-    LoadedServerDll->ConnectCallback = NULL;
-    LoadedServerDll->DisconnectCallback = NULL;
-    LoadedServerDll->HardErrorCallback = UserServerHardError;
-    LoadedServerDll->ShutdownProcessCallback = NULL;
-
-    UserServerDllInstance = LoadedServerDll->ServerHandle;
-
-/*** From win32csr... See r54125 ***/
-    /* Start the Raw Input Thread and the Desktop Thread */
-    for (i = 0; i < 2; ++i)
-    {
-        Status = RtlCreateUserThread(NtCurrentProcess(), NULL, TRUE, 0, 0, 0, (PTHREAD_START_ROUTINE)CreateSystemThreads, (PVOID)i, &ServerThread, &ClientId);
-        if (NT_SUCCESS(Status))
-        {
-            NtResumeThread(ServerThread, NULL);
-            NtClose(ServerThread);
-        }
-        else
-            DPRINT1("Cannot start Raw Input Thread!\n");
-    }
-/*** END - From win32csr... ***/
-
-    /* All done */
-    return STATUS_SUCCESS;
-}
-
 BOOL
 WINAPI
 DllMain(IN HINSTANCE hInstanceDll,
diff --git a/reactos/win32ss/user/winsrv/usersrv.cmake b/reactos/win32ss/user/winsrv/usersrv.cmake
new file mode 100644 (file)
index 0000000..1cf6e9a
--- /dev/null
@@ -0,0 +1,15 @@
+
+include_directories(usersrv)
+
+list(APPEND USERSRV_SOURCE
+    usersrv/harderror.c
+    usersrv/init.c
+    usersrv/register.c
+    usersrv/shutdown.c
+    # usersrv/usersrv.rc
+    )
+
+add_library(usersrv ${USERSRV_SOURCE})
+#add_object_library(usersrv ${USERSRV_SOURCE})
+
+set_module_type(usersrv module UNICODE)
similarity index 91%
rename from reactos/win32ss/user/winsrv/api.h
rename to reactos/win32ss/user/winsrv/usersrv/api.h
index b3a826d..478adf0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User API Server DLL
- * FILE:            win32ss/user/winsrv/api.h
+ * FILE:            win32ss/user/winsrv/usersrv/api.h
  * PURPOSE:         Public server APIs definitions
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
similarity index 99%
rename from reactos/win32ss/user/winsrv/harderror.c
rename to reactos/win32ss/user/winsrv/usersrv/harderror.c
index 708321e..31281c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User API Server DLL
- * FILE:            win32ss/user/winsrv/harderror.c
+ * FILE:            win32ss/user/winsrv/usersrv/harderror.c
  * PURPOSE:         Hard errors
  * PROGRAMMERS:     Dmitry Philippov (shedon@mail.ru)
  *                  Timo Kreuzer (timo.kreuzer@reactos.org)
@@ -9,7 +9,7 @@
 
 /* INCLUDES *******************************************************************/
 
-#include "winsrv.h"
+#include "usersrv.h"
 
 #define NDEBUG
 #include <debug.h>
diff --git a/reactos/win32ss/user/winsrv/usersrv/init.c b/reactos/win32ss/user/winsrv/usersrv/init.c
new file mode 100644 (file)
index 0000000..0cf5288
--- /dev/null
@@ -0,0 +1,298 @@
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS User API Server DLL
+ * FILE:            win32ss/user/winsrv/usersrv/init.c
+ * PURPOSE:         Initialization
+ * PROGRAMMERS:     Dmitry Philippov (shedon@mail.ru)
+ *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include "usersrv.h"
+#include "api.h"
+
+#define NDEBUG
+#include <debug.h>
+
+/* GLOBALS ********************************************************************/
+
+HINSTANCE UserServerDllInstance = NULL;
+
+/* Memory */
+HANDLE UserServerHeap = NULL;   // Our own heap.
+
+// Windows Server 2003 table from http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_2k3
+PCSR_API_ROUTINE UserServerApiDispatchTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
+{
+    SrvExitWindowsEx,
+    // SrvEndTask,
+    // SrvLogon,
+    SrvRegisterServicesProcess, // Not present in Win7
+    // SrvActivateDebugger,
+    // SrvGetThreadConsoleDesktop, // Not present in Win7
+    // SrvDeviceEvent,
+    SrvRegisterLogonProcess,    // Not present in Win7
+    // SrvCreateSystemThreads,
+    // SrvRecordShutdownReason,
+    // SrvCancelShutdown,              // Added in Vista
+    // SrvConsoleHandleOperation,      // Added in Win7
+    // SrvGetSetShutdownBlockReason,   // Added in Vista
+};
+
+BOOLEAN UserServerApiServerValidTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
+{
+    FALSE,   // SrvExitWindowsEx
+    // FALSE,   // SrvEndTask
+    // FALSE,   // SrvLogon
+    FALSE,   // SrvRegisterServicesProcess
+    // FALSE,   // SrvActivateDebugger
+    // TRUE,    // SrvGetThreadConsoleDesktop
+    // FALSE,   // SrvDeviceEvent
+    FALSE,   // SrvRegisterLogonProcess
+    // FALSE,   // SrvCreateSystemThreads
+    // FALSE,   // SrvRecordShutdownReason
+    // FALSE,   // SrvCancelShutdown
+    // FALSE,   // SrvConsoleHandleOperation
+    // FALSE,   // SrvGetSetShutdownBlockReason
+};
+
+PCHAR UserServerApiNameTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
+{
+    "SrvExitWindowsEx",
+    // "SrvEndTask",
+    // "SrvLogon",
+    "SrvRegisterServicesProcess",
+    // "SrvActivateDebugger",
+    // "SrvGetThreadConsoleDesktop",
+    // "SrvDeviceEvent",
+    "SrvRegisterLogonProcess",
+    // "SrvCreateSystemThreads",
+    // "SrvRecordShutdownReason",
+    // "SrvCancelShutdown",
+    // "SrvConsoleHandleOperation",
+    // "SrvGetSetShutdownBlockReason",
+};
+
+
+/* FUNCTIONS ******************************************************************/
+
+// PUSER_SOUND_SENTRY. Used in basesrv.dll
+BOOL WINAPI _UserSoundSentry(VOID)
+{
+    // TODO: Do something.
+    return TRUE;
+}
+
+ULONG
+InitializeVideoAddressSpace(VOID)
+{
+    OBJECT_ATTRIBUTES ObjectAttributes;
+    UNICODE_STRING PhysMemName = RTL_CONSTANT_STRING(L"\\Device\\PhysicalMemory");
+    NTSTATUS Status;
+    HANDLE PhysMemHandle;
+    PVOID BaseAddress;
+    LARGE_INTEGER Offset;
+    SIZE_T ViewSize;
+    CHAR IVTAndBda[1024+256];
+    
+    /* Free the 1MB pre-reserved region. In reality, ReactOS should simply support us mapping the view into the reserved area, but it doesn't. */
+    BaseAddress = 0;
+    ViewSize = 1024 * 1024;
+    Status = ZwFreeVirtualMemory(NtCurrentProcess(), 
+                                 &BaseAddress,
+                                 &ViewSize,
+                                 MEM_RELEASE);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("Couldn't unmap reserved memory (%x)\n", Status);
+        return 0;
+    }
+    
+    /* Open the physical memory section */
+    InitializeObjectAttributes(&ObjectAttributes,
+                               &PhysMemName,
+                               0,
+                               NULL,
+                               NULL);
+    Status = ZwOpenSection(&PhysMemHandle,
+                           SECTION_ALL_ACCESS,
+                           &ObjectAttributes);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("Couldn't open \\Device\\PhysicalMemory\n");
+        return 0;
+    }
+
+    /* Map the BIOS and device registers into the address space */
+    Offset.QuadPart = 0xa0000;
+    ViewSize = 0x100000 - 0xa0000;
+    BaseAddress = (PVOID)0xa0000;
+    Status = ZwMapViewOfSection(PhysMemHandle,
+                                NtCurrentProcess(),
+                                &BaseAddress,
+                                0,
+                                ViewSize,
+                                &Offset,
+                                &ViewSize,
+                                ViewUnmap,
+                                0,
+                                PAGE_EXECUTE_READWRITE);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("Couldn't map physical memory (%x)\n", Status);
+        ZwClose(PhysMemHandle);
+        return 0;
+    }
+
+    /* Close physical memory section handle */
+    ZwClose(PhysMemHandle);
+
+    if (BaseAddress != (PVOID)0xa0000)
+    {
+        DPRINT1("Couldn't map physical memory at the right address (was %x)\n",
+                BaseAddress);
+        return 0;
+    }
+
+    /* Allocate some low memory to use for the non-BIOS
+     * parts of the v86 mode address space
+     */
+    BaseAddress = (PVOID)0x1;
+    ViewSize = 0xa0000 - 0x1000;
+    Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
+                                     &BaseAddress,
+                                     0,
+                                     &ViewSize,
+                                     MEM_RESERVE | MEM_COMMIT,
+                                     PAGE_EXECUTE_READWRITE);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("Failed to allocate virtual memory (Status %x)\n", Status);
+        return 0;
+    }
+    if (BaseAddress != (PVOID)0x0)
+    {
+        DPRINT1("Failed to allocate virtual memory at right address (was %x)\n",
+                BaseAddress);
+        return 0;
+    }
+
+    /* Get the real mode IVT and BDA from the kernel */
+    Status = NtVdmControl(VdmInitialize, IVTAndBda);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("NtVdmControl failed (status %x)\n", Status);
+        return 0;
+    }
+
+    /* Return success */
+    return 1;
+}
+
+/**********************************************************************
+ * UserpInitVideo
+ *
+ * TODO: we need a virtual device for sessions other than
+ * TODO: the console one
+ */
+NTSTATUS
+UserpInitVideo(VOID)
+{
+    OBJECT_ATTRIBUTES ObjectAttributes;
+    UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\??\\DISPLAY1");
+    IO_STATUS_BLOCK Iosb;
+    HANDLE VideoHandle = (HANDLE) 0;
+    NTSTATUS Status = STATUS_SUCCESS;
+
+    DPRINT("CSR: %s called\n", __FUNCTION__);
+
+    InitializeVideoAddressSpace();
+
+    InitializeObjectAttributes(&ObjectAttributes,
+                               &DeviceName,
+                               0,
+                               NULL,
+                               NULL);
+    Status = NtOpenFile(&VideoHandle,
+                        FILE_ALL_ACCESS,
+                        &ObjectAttributes,
+                        &Iosb,
+                        0,
+                        0);
+    if (NT_SUCCESS(Status))
+    {
+        NtClose(VideoHandle);
+    }
+
+    return Status;
+}
+
+// From win32ss/user/win32csr/dllmain.c
+VOID
+WINAPI
+PrivateCsrssManualGuiCheck(LONG Check)
+{
+    NtUserCallOneParam(Check, ONEPARAM_ROUTINE_CSRSS_GUICHECK);
+}
+
+DWORD
+WINAPI
+CreateSystemThreads(PVOID pParam)
+{
+    NtUserCallOneParam((DWORD)pParam, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS);
+    DPRINT1("This thread should not terminate!\n");
+    return 0;
+}
+
+CSR_SERVER_DLL_INIT(UserServerDllInitialization)
+{
+/*** From win32csr... ***/
+    HANDLE ServerThread;
+    CLIENT_ID ClientId;
+    NTSTATUS Status;
+    UINT i;
+/*** END - From win32csr... ***/
+
+    /* Initialize the memory */
+    UserServerHeap = RtlGetProcessHeap();
+
+    /* Initialize the video */
+    UserpInitVideo();
+    NtUserInitialize(0, NULL, NULL);
+    PrivateCsrssManualGuiCheck(0);
+
+    /* Setup the DLL Object */
+    LoadedServerDll->ApiBase = USERSRV_FIRST_API_NUMBER;
+    LoadedServerDll->HighestApiSupported = UserpMaxApiNumber;
+    LoadedServerDll->DispatchTable = UserServerApiDispatchTable;
+    LoadedServerDll->ValidTable = UserServerApiServerValidTable;
+    LoadedServerDll->NameTable = UserServerApiNameTable;
+    LoadedServerDll->SizeOfProcessData = 0;
+    LoadedServerDll->ConnectCallback = NULL;
+    LoadedServerDll->DisconnectCallback = NULL;
+    LoadedServerDll->HardErrorCallback = UserServerHardError;
+    LoadedServerDll->ShutdownProcessCallback = NULL;
+
+    UserServerDllInstance = LoadedServerDll->ServerHandle;
+
+/*** From win32csr... See r54125 ***/
+    /* Start the Raw Input Thread and the Desktop Thread */
+    for (i = 0; i < 2; ++i)
+    {
+        Status = RtlCreateUserThread(NtCurrentProcess(), NULL, TRUE, 0, 0, 0, (PTHREAD_START_ROUTINE)CreateSystemThreads, (PVOID)i, &ServerThread, &ClientId);
+        if (NT_SUCCESS(Status))
+        {
+            NtResumeThread(ServerThread, NULL);
+            NtClose(ServerThread);
+        }
+        else
+            DPRINT1("Cannot start Raw Input Thread!\n");
+    }
+/*** END - From win32csr... ***/
+
+    /* All done */
+    return STATUS_SUCCESS;
+}
+
+/* EOF */
similarity index 96%
rename from reactos/win32ss/user/winsrv/register.c
rename to reactos/win32ss/user/winsrv/usersrv/register.c
index f571d38..5322075 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User API Server DLL
- * FILE:            win32ss/user/winsrv/register.c
+ * FILE:            win32ss/user/winsrv/usersrv/register.c
  * PURPOSE:         Register logon window and services process
  * PROGRAMMERS:     Eric Kohl
  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
@@ -9,7 +9,7 @@
 
 /* INCLUDES *******************************************************************/
 
-#include "winsrv.h"
+#include "usersrv.h"
 
 #define NDEBUG
 #include <debug.h>
similarity index 86%
rename from reactos/win32ss/user/winsrv/resource.h
rename to reactos/win32ss/user/winsrv/usersrv/resource.h
index 2bfeae7..2f0d6ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User API Server DLL
- * FILE:            win32ss/user/winsrv/resource.h
+ * FILE:            win32ss/user/winsrv/usersrv/resource.h
  * PURPOSE:         Resource #defines
  */
 
similarity index 99%
rename from reactos/win32ss/user/winsrv/shutdown.c
rename to reactos/win32ss/user/winsrv/usersrv/shutdown.c
index 24bf556..12f3a12 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User API Server DLL
- * FILE:            win32ss/user/winsrv/shutdown.c
+ * FILE:            win32ss/user/winsrv/usersrv/shutdown.c
  * PURPOSE:         Logout/shutdown
  * PROGRAMMERS:
  *
@@ -10,7 +10,7 @@
 
 /* INCLUDES *******************************************************************/
 
-#include "winsrv.h"
+#include "usersrv.h"
 #include <sddl.h>
 
 #define NDEBUG
@@ -430,7 +430,6 @@ NotifyTopLevelWindows(PNOTIFY_CONTEXT Context)
     return TRUE;
 }
 
-/*** Taken from win32ss/user/consrv/console.c ***/
 static BOOL
 DtbgIsDesktopVisible(VOID)
 {
similarity index 89%
rename from reactos/win32ss/user/winsrv/winsrv.h
rename to reactos/win32ss/user/winsrv/usersrv/usersrv.h
index a3f642c..3ac83be 100644 (file)
@@ -1,13 +1,13 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS User API Server DLL
- * FILE:            win32ss/user/winsrv/winsrv.h
+ * FILE:            win32ss/user/winsrv/usersrv/usersrv.h
  * PURPOSE:         Main header - Definitions
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
  */
 
-#ifndef __WINSRV_H__
-#define __WINSRV_H__
+#ifndef __USERSRV_H__
+#define __USERSRV_H__
 
 #pragma once
 
@@ -56,6 +56,6 @@ extern HINSTANCE UserServerDllInstance;
 extern HANDLE UserServerHeap;
 extern ULONG_PTR LogonProcessId;
 
-#endif // __WINSRV_H__
+#endif // __USERSRV_H__
 
 /* EOF */
diff --git a/reactos/win32ss/user/winsrv/usersrv/usersrv.rc b/reactos/win32ss/user/winsrv/usersrv/usersrv.rc
new file mode 100644 (file)
index 0000000..1cd56b5
--- /dev/null
@@ -0,0 +1,5 @@
+#include <windef.h>
+#include <winuser.h>
+#include "resource.h"
+
+#include "rsrc.rc"
index 044ecca..062bd69 100644 (file)
@@ -1,13 +1,13 @@
 #include <windef.h>
 #include <winuser.h>
-#include "resource.h"
 
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
 #define REACTOS_VERSION_DLL
-#define REACTOS_STR_FILE_DESCRIPTION    "ReactOS User API Server DLL"
+#define REACTOS_STR_FILE_DESCRIPTION    "ReactOS User API & Console Server & Terminal Emulator DLL"
 #define REACTOS_STR_INTERNAL_NAME       "winsrv"
 #define REACTOS_STR_ORIGINAL_FILENAME   "winsrv.dll"
 #include <reactos/version.rc>
 
-#include "rsrc.rc"
+#include "consrv/consrv.rc"
+#include "usersrv/usersrv.rc"
index 79e7e25..afc55aa 100644 (file)
@@ -1,2 +1,3 @@
+@ stdcall ConServerDllInitialization(ptr)
 @ stdcall UserServerDllInitialization(ptr)
 @ stdcall _UserSoundSentry()