Author: hbelusca
Date: Tue Dec 16 20:15:35 2014
New Revision: 65684
URL:
http://svn.reactos.org/svn/reactos?rev=65684&view=rev
Log:
[BASESRV]
- Introduce BaseClientConnectRoutine and BaseClientDisconnectRoutine functions that do
basesrv (de)initialization, and BaseSrvNlsConnect that may potentially init further NLS
support in the future.
- BaseSrvDebugProcess is deprecated in Windows 2k3+.
- Few whitespace fixes.
Piece of patch by Timo Kreuzer.
CORE-7505 #comment Basesrv (dis)connect routines committed in r65684.
Modified:
trunk/reactos/include/reactos/subsys/win/base.h
trunk/reactos/include/reactos/subsys/win/basemsg.h
trunk/reactos/subsystems/win/basesrv/api.h
trunk/reactos/subsystems/win/basesrv/init.c
trunk/reactos/subsystems/win/basesrv/nls.c
trunk/reactos/subsystems/win/basesrv/proc.c
trunk/reactos/subsystems/win/basesrv/sndsntry.c
trunk/reactos/win32ss/user/winsrv/consrv/init.c
Modified: trunk/reactos/include/reactos/subsys/win/base.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/win…
==============================================================================
--- trunk/reactos/include/reactos/subsys/win/base.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/win/base.h [iso-8859-1] Tue Dec 16 20:15:35 2014
@@ -13,7 +13,7 @@
typedef
BOOL
-(CALLBACK * BASE_PROCESS_CREATE_NOTIFY_ROUTINE)(
+(CALLBACK *BASE_PROCESS_CREATE_NOTIFY_ROUTINE)(
HANDLE NewProcessId,
HANDLE SourceThreadId,
DWORD dwUnknown,
@@ -135,8 +135,6 @@
C_ASSERT(sizeof(BASE_STATIC_SERVER_DATA) == 0x1AC8);
#endif
-VOID WINAPI BaseSrvNLSInit(IN PBASE_STATIC_SERVER_DATA StaticData);
-
#endif // _BASE_H
/* EOF */
Modified: trunk/reactos/include/reactos/subsys/win/basemsg.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/win…
==============================================================================
--- trunk/reactos/include/reactos/subsys/win/basemsg.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/win/basemsg.h [iso-8859-1] Tue Dec 16 20:15:35
2014
@@ -22,7 +22,7 @@
BasepCreateThread,
BasepGetTempFile,
BasepExitProcess,
- BasepDebugProcess,
+ BasepDebugProcess, // Deprecated
BasepCheckVDM,
BasepUpdateVDMEntry,
BasepGetNextVDMCommand,
@@ -46,7 +46,7 @@
BasepNlsUpdateCacheCount,
BasepSetTermsrvClientTimeZone,
BasepSxsCreateActivationContext,
- BasepUnknown,
+ BasepDebugProcessStop, // Alias to BasepDebugProcess, deprecated
BasepRegisterThread,
BasepNlsGetUserInfo,
@@ -72,7 +72,7 @@
{
ULONG Flags;
ULONG ProcessParameterFlags;
- HANDLE FileHandle;
+ HANDLE FileHandle;
UNICODE_STRING SxsWin32ExePath;
UNICODE_STRING SxsNtExePath;
SIZE_T OverrideManifestOffset;
Modified: trunk/reactos/subsystems/win/basesrv/api.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/api…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/api.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/api.h [iso-8859-1] Tue Dec 16 20:15:35 2014
@@ -29,7 +29,6 @@
CSR_API(BaseSrvSxsCreateActivationContext);
CSR_API(BaseSrvSetTermsrvAppInstallMode);
CSR_API(BaseSrvSetTermsrvClientTimeZone);
-CSR_API(BaseSrvUnknown);
/* sndsntry.c */
CSR_API(BaseSrvSoundSentryNotification);
@@ -49,6 +48,16 @@
CSR_API(BaseSrvRefreshIniFileMapping);
/* nls.c */
+VOID
+NTAPI
+BaseSrvNLSInit(IN PBASE_STATIC_SERVER_DATA StaticData);
+
+NTSTATUS
+NTAPI
+BaseSrvNlsConnect(IN PCSR_PROCESS CsrProcess,
+ IN OUT PVOID ConnectionInfo,
+ IN OUT PULONG ConnectionInfoLength);
+
CSR_API(BaseSrvNlsSetUserInfo);
CSR_API(BaseSrvNlsSetMultipleUserInfo);
CSR_API(BaseSrvNlsCreateSection);
Modified: trunk/reactos/subsystems/win/basesrv/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/ini…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/init.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/init.c [iso-8859-1] Tue Dec 16 20:15:35 2014
@@ -61,7 +61,7 @@
BaseSrvNlsUpdateCacheCount,
BaseSrvSetTermsrvClientTimeZone,
BaseSrvSxsCreateActivationContext,
- BaseSrvUnknown,
+ BaseSrvDebugProcess,
BaseSrvRegisterThread,
BaseSrvNlsGetUserInfo,
};
@@ -96,7 +96,7 @@
TRUE, // BaseSrvNlsUpdateCacheCount
TRUE, // BaseSrvSetTermsrvClientTimeZone
TRUE, // BaseSrvSxsCreateActivationContext
- TRUE, // BaseSrvUnknown
+ FALSE, // BaseSrvDebugProcess
TRUE, // BaseSrvRegisterThread
TRUE, // BaseSrvNlsGetUserInfo
};
@@ -136,7 +136,7 @@
"BaseNlsUpdateCacheCount",
"BaseSetTermsrvClientTimeZone",
"BaseSxsCreateActivationContext",
- "BaseUnknown",
+ "BaseSrvDebugProcessStop",
"BaseRegisterThread",
"BaseNlsGetUserInfo",
};
@@ -570,12 +570,37 @@
LoadedServerDll->SharedSection = BaseStaticServerData;
}
+NTSTATUS
+NTAPI
+BaseClientConnectRoutine(IN PCSR_PROCESS CsrProcess,
+ IN OUT PVOID ConnectionInfo,
+ IN OUT PULONG ConnectionInfoLength)
+{
+ PBASESRV_API_CONNECTINFO ConnectInfo = (PBASESRV_API_CONNECTINFO)ConnectionInfo;
+
+ if ( ConnectionInfo == NULL ||
+ ConnectionInfoLength == NULL ||
+ *ConnectionInfoLength != sizeof(*ConnectInfo) )
+ {
+ DPRINT1("BASESRV: Connection failed - ConnectionInfo = 0x%p ;
ConnectionInfoLength = 0x%p (%lu), expected %lu\n",
+ ConnectionInfo,
+ ConnectionInfoLength,
+ ConnectionInfoLength ? *ConnectionInfoLength : (ULONG)-1,
+ sizeof(*ConnectInfo));
+
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* Do the NLS connection */
+ return BaseSrvNlsConnect(CsrProcess, ConnectionInfo, ConnectionInfoLength);
+}
+
VOID
NTAPI
-BaseSrvDisconnect(PCSR_PROCESS Process)
+BaseClientDisconnectRoutine(IN PCSR_PROCESS CsrProcess)
{
/* Cleanup the VDM console records */
- BaseSrvCleanupVdmRecords(HandleToUlong(Process->ClientId.UniqueProcess));
+ BaseSrvCleanupVdmRecords(HandleToUlong(CsrProcess->ClientId.UniqueProcess));
}
CSR_SERVER_DLL_INIT(ServerDllInitialization)
@@ -589,8 +614,8 @@
LoadedServerDll->NameTable = BaseServerApiNameTable;
#endif
LoadedServerDll->SizeOfProcessData = 0;
- LoadedServerDll->ConnectCallback = NULL;
- LoadedServerDll->DisconnectCallback = BaseSrvDisconnect;
+ LoadedServerDll->ConnectCallback = BaseClientConnectRoutine;
+ LoadedServerDll->DisconnectCallback = BaseClientDisconnectRoutine;
LoadedServerDll->ShutdownProcessCallback = NULL;
BaseSrvDllInstance = LoadedServerDll->ServerHandle;
Modified: trunk/reactos/subsystems/win/basesrv/nls.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/nls…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/nls.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/nls.c [iso-8859-1] Tue Dec 16 20:15:35 2014
@@ -108,7 +108,7 @@
}
VOID
-WINAPI
+NTAPI
BaseSrvNLSInit(IN PBASE_STATIC_SERVER_DATA StaticData)
{
/* Initialize the lock */
@@ -128,6 +128,16 @@
/* Get the LCID */
NtQueryDefaultLocale(0, &pNlsRegUserInfo->UserLocaleId);
+}
+
+NTSTATUS
+NTAPI
+BaseSrvNlsConnect(IN PCSR_PROCESS CsrProcess,
+ IN OUT PVOID ConnectionInfo,
+ IN OUT PULONG ConnectionInfoLength)
+{
+ /* Does nothing */
+ return STATUS_SUCCESS;
}
/* PUBLIC SERVER APIS *********************************************************/
Modified: trunk/reactos/subsystems/win/basesrv/proc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/pro…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/proc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/proc.c [iso-8859-1] Tue Dec 16 20:15:35 2014
@@ -18,34 +18,29 @@
CSR_API(BaseSrvDebugProcess)
{
+ /* Deprecated */
+ return STATUS_UNSUCCESSFUL;
+}
+
+CSR_API(BaseSrvRegisterThread)
+{
DPRINT1("%s not yet implemented\n", __FUNCTION__);
return STATUS_NOT_IMPLEMENTED;
}
-CSR_API(BaseSrvRegisterThread)
+CSR_API(BaseSrvSxsCreateActivationContext)
{
DPRINT1("%s not yet implemented\n", __FUNCTION__);
return STATUS_NOT_IMPLEMENTED;
}
-CSR_API(BaseSrvSxsCreateActivationContext)
+
+CSR_API(BaseSrvSetTermsrvAppInstallMode)
{
DPRINT1("%s not yet implemented\n", __FUNCTION__);
return STATUS_NOT_IMPLEMENTED;
}
-CSR_API(BaseSrvSetTermsrvAppInstallMode)
-{
- DPRINT1("%s not yet implemented\n", __FUNCTION__);
- return STATUS_NOT_IMPLEMENTED;
-}
-
CSR_API(BaseSrvSetTermsrvClientTimeZone)
-{
- DPRINT1("%s not yet implemented\n", __FUNCTION__);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-CSR_API(BaseSrvUnknown)
{
DPRINT1("%s not yet implemented\n", __FUNCTION__);
return STATUS_NOT_IMPLEMENTED;
Modified: trunk/reactos/subsystems/win/basesrv/sndsntry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/snd…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/sndsntry.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/sndsntry.c [iso-8859-1] Tue Dec 16 20:15:35 2014
@@ -15,7 +15,7 @@
/* GLOBALS ********************************************************************/
-typedef BOOL (WINAPI *PUSER_SOUND_SENTRY)(VOID);
+typedef BOOL (NTAPI *PUSER_SOUND_SENTRY)(VOID);
BOOL NTAPI FirstSoundSentry(VOID);
static PUSER_SOUND_SENTRY _UserSoundSentry = FirstSoundSentry;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/init.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/init.c [iso-8859-1] Tue Dec 16 20:15:35 2014
@@ -420,11 +420,12 @@
ConnectionInfoLength == NULL ||
*ConnectionInfoLength != sizeof(*ConnectInfo) )
{
- DPRINT1("CONSRV: Connection failed - ConnectionInfo = 0x%p ;
ConnectionInfoLength = 0x%p (%lu), wanted %lu\n",
+ DPRINT1("CONSRV: Connection failed - ConnectionInfo = 0x%p ;
ConnectionInfoLength = 0x%p (%lu), expected %lu\n",
ConnectionInfo,
ConnectionInfoLength,
ConnectionInfoLength ? *ConnectionInfoLength : (ULONG)-1,
sizeof(*ConnectInfo));
+
return STATUS_UNSUCCESSFUL;
}
@@ -500,9 +501,9 @@
VOID
NTAPI
-ConSrvDisconnect(PCSR_PROCESS Process)
-{
- PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(Process);
+ConSrvDisconnect(IN PCSR_PROCESS CsrProcess)
+{
+ PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrProcess);
/**************************************************************************
* This function is called whenever a new process (GUI or CUI) is destroyed.