mirror of
https://github.com/reactos/reactos.git
synced 2024-07-21 11:48:04 +00:00
Remove screensaver implementation of win32k (ie revert revision 22879).
svn path=/trunk/; revision=24011
This commit is contained in:
parent
b61c75703c
commit
c965755754
|
@ -410,12 +410,6 @@ typedef struct
|
|||
HANDLE InputWaitHandle;
|
||||
} CSRSS_GET_INPUT_WAIT_HANDLE, *PCSRSS_GET_INPUT_WAIT_HANDLE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BOOL Start;
|
||||
} CSRSS_START_SCREEN_SAVER, *PCSRSS_START_SCREEN_SAVER;
|
||||
|
||||
|
||||
#define CSR_API_MESSAGE_HEADER_SIZE(Type) (FIELD_OFFSET(CSR_API_MESSAGE, Data) + sizeof(Type))
|
||||
#define CSRSS_MAX_WRITE_CONSOLE (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE))
|
||||
#define CSRSS_MAX_WRITE_CONSOLE_OUTPUT_CHAR (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE_OUTPUT_CHAR))
|
||||
|
@ -549,7 +543,6 @@ typedef struct _CSR_API_MESSAGE
|
|||
CSRSS_SET_CONSOLE_OUTPUT_CP SetConsoleOutputCodePage;
|
||||
CSRSS_GET_INPUT_WAIT_HANDLE GetConsoleInputWaitHandle;
|
||||
CSRSS_GET_PROCESS_LIST GetProcessListRequest;
|
||||
CSRSS_START_SCREEN_SAVER StartScreenSaver;
|
||||
} Data;
|
||||
} CSR_API_MESSAGE, *PCSR_API_MESSAGE;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ CSR_API(CsrCreateDesktop);
|
|||
CSR_API(CsrShowDesktop);
|
||||
CSR_API(CsrHideDesktop);
|
||||
CSR_API(CsrRegisterSystemClasses);
|
||||
CSR_API(CsrStartScreenSaver);
|
||||
|
||||
BOOL FASTCALL DtbgIsDesktopVisible(VOID);
|
||||
|
||||
|
|
|
@ -3343,89 +3343,4 @@ CSR_API(CsrGetProcessList)
|
|||
return Request->Status = STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
CSR_API(CsrStartScreenSaver)
|
||||
{
|
||||
|
||||
DPRINT("CsrStartScreenSaver : %s Screen Saver \n",
|
||||
(Request->Data.StartScreenSaver.Start) ? "Start" : "Stop");
|
||||
|
||||
if (Request->Data.StartScreenSaver.Start == TRUE)
|
||||
{
|
||||
STARTUPINFOW si;
|
||||
PROCESS_INFORMATION pi;
|
||||
WCHAR szCmdline[MAX_PATH];
|
||||
|
||||
HKEY hKey;
|
||||
WCHAR szBuffer[MAX_PATH];
|
||||
DWORD bufferSize = sizeof(szBuffer);
|
||||
DWORD varType = REG_SZ;
|
||||
LONG result;
|
||||
|
||||
/* FIXME :
|
||||
1. Make it unicode and ansi compatible with TCHAR
|
||||
|
||||
2. Return state it is running if a tree try start it
|
||||
one more screen saver when we already have one
|
||||
screen saver running
|
||||
|
||||
3. Use GetLongPath or GetPathName so we can use %SystemRoot% in
|
||||
the key that will make it posible for livecd have a preview screen
|
||||
saver install.
|
||||
|
||||
4. Move the code to winlogon SAS and screen saver must run in
|
||||
the secuar desktop. But current our Winlogon does not working
|
||||
well with SAS and with Secure desktop, So I (Magnus Olsen aka GreatLord)
|
||||
add the code here as w3seek recomandete
|
||||
*/
|
||||
|
||||
result = RegOpenKeyExW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", 0, KEY_QUERY_VALUE, &hKey);
|
||||
if (result == ERROR_SUCCESS)
|
||||
{
|
||||
result = RegQueryValueExW(hKey, L"SCRNSAVE.EXE", 0, &varType, (LPBYTE)szBuffer, &bufferSize);
|
||||
if(result == ERROR_SUCCESS)
|
||||
{
|
||||
swprintf(szCmdline, L"%s /s",szBuffer);
|
||||
DPRINT("CsrStartScreenSaver : OK %S, Name %S\n", szCmdline, szBuffer);
|
||||
ZeroMemory( &si, sizeof(si) );
|
||||
si.cb = sizeof(si);
|
||||
ZeroMemory( &pi, sizeof(pi) );
|
||||
if(CreateProcessW( NULL, szCmdline, NULL, NULL, FALSE, 0, NULL,NULL,&si, &pi ))
|
||||
{
|
||||
CloseHandle( pi.hProcess );
|
||||
CloseHandle( pi.hThread );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GetSystemDirectoryW(szCmdline,MAX_PATH);
|
||||
wprintf(szCmdline, L"%s\\%s /s",szCmdline,szBuffer);
|
||||
DPRINT("CsrStartScreenSaver : OK %S, Name %S\n", szCmdline, szBuffer);
|
||||
ZeroMemory( &si, sizeof(si) );
|
||||
si.cb = sizeof(si);
|
||||
ZeroMemory( &pi, sizeof(pi) );
|
||||
if(CreateProcessW( NULL, szCmdline, NULL, NULL, FALSE, 0, NULL,NULL,&si, &pi ))
|
||||
{
|
||||
CloseHandle( pi.hProcess );
|
||||
CloseHandle( pi.hThread );
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT("CsrStartScreenSaver : failed 0x%08X\n", result);
|
||||
}
|
||||
}
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("CsrStartScreenSaver : failed to RegOpenKeyExW (error 0x%lx)\n", result);
|
||||
}
|
||||
return Request->Status = STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TODO: Stopping the screensaver */
|
||||
return Request->Status = STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -68,7 +68,6 @@ static CSRSS_API_DEFINITION Win32CsrApiDefinitions[] =
|
|||
CSRSS_DEFINE_API(GET_CONSOLE_OUTPUT_CP, CsrGetConsoleOutputCodePage),
|
||||
CSRSS_DEFINE_API(SET_CONSOLE_OUTPUT_CP, CsrSetConsoleOutputCodePage),
|
||||
CSRSS_DEFINE_API(GET_PROCESS_LIST, CsrGetProcessList),
|
||||
CSRSS_DEFINE_API(START_SCREEN_SAVER, CsrStartScreenSaver),
|
||||
{ 0, 0, NULL }
|
||||
};
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ extern PEPROCESS CsrProcess;
|
|||
|
||||
NTSTATUS FASTCALL CsrInit(void);
|
||||
NTSTATUS FASTCALL co_CsrNotify(PCSR_API_MESSAGE Request);
|
||||
NTSTATUS FASTCALL co_CsrNotifyScreenSaver(PCSR_API_MESSAGE Request);
|
||||
NTSTATUS FASTCALL CsrCloseHandle(HANDLE Handle);
|
||||
NTSTATUS WINAPI CsrInsertObject(HANDLE ObjectHandle,
|
||||
ACCESS_MASK DesiredAccess,
|
||||
|
|
|
@ -86,46 +86,6 @@ co_CsrNotify(PCSR_API_MESSAGE Request)
|
|||
}
|
||||
|
||||
|
||||
NTSTATUS FASTCALL
|
||||
co_CsrNotifyScreenSaver(PCSR_API_MESSAGE Request)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PEPROCESS OldProcess;
|
||||
|
||||
if (NULL == CsrProcess)
|
||||
{
|
||||
return STATUS_INVALID_PORT_HANDLE;
|
||||
}
|
||||
|
||||
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
|
||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
||||
|
||||
/* Switch to the process in which the WindowsApiPort handle is valid */
|
||||
OldProcess = PsGetCurrentProcess();
|
||||
if (CsrProcess != OldProcess)
|
||||
{
|
||||
KeAttachProcess(&CsrProcess->Pcb);
|
||||
}
|
||||
|
||||
Status = ZwRequestWaitReplyPort(WindowsApiPort,
|
||||
&Request->Header,
|
||||
&Request->Header);
|
||||
|
||||
|
||||
if (CsrProcess != OldProcess)
|
||||
{
|
||||
KeDetachProcess();
|
||||
}
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
Status = Request->Status;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
CsrInsertObject(HANDLE ObjectHandle,
|
||||
|
|
Loading…
Reference in a new issue