ReactOS 0.4.15-dev-5666-gc548b97
thmsvc.c File Reference
#include <windows.h>
#include <wine/debug.h>
Include dependency graph for thmsvc.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shsvcs)
 
static VOID UpdateServiceStatus (DWORD dwState)
 
static DWORD WINAPI ServiceControlHandler (DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
 
VOID WINAPI ThemeServiceMain (DWORD argc, LPTSTR *argv)
 

Variables

static WCHAR ServiceName [] = L"Themes"
 
SERVICE_STATUS_HANDLE ServiceStatusHandle
 
SERVICE_STATUS ServiceStatus
 
HANDLE StartEvent
 
HANDLE StopEvent
 

Function Documentation

◆ ServiceControlHandler()

static DWORD WINAPI ServiceControlHandler ( DWORD  dwControl,
DWORD  dwEventType,
LPVOID  lpEventData,
LPVOID  lpContext 
)
static

Definition at line 59 of file thmsvc.c.

63{
64 TRACE("ServiceControlHandler() called\n");
65
66 switch (dwControl)
67 {
69 TRACE(" SERVICE_CONTROL_STOP received\n");
70
71 /* Signal the theme server in winlogon to remove theme hooks */
75 return ERROR_SUCCESS;
76
78 TRACE(" SERVICE_CONTROL_PAUSE received\n");
80 return ERROR_SUCCESS;
81
83 TRACE(" SERVICE_CONTROL_CONTINUE received\n");
85 return ERROR_SUCCESS;
86
88 TRACE(" SERVICE_CONTROL_INTERROGATE received\n");
91 return ERROR_SUCCESS;
92
94 TRACE(" SERVICE_CONTROL_SHUTDOWN received\n");
96 return ERROR_SUCCESS;
97
98 default :
99 TRACE(" Control %lu received\n");
101 }
102}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
Definition: sctrl.c:997
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
HANDLE StartEvent
Definition: thmsvc.c:26
static VOID UpdateServiceStatus(DWORD dwState)
Definition: thmsvc.c:29
SERVICE_STATUS_HANDLE ServiceStatusHandle
Definition: thmsvc.c:20
SERVICE_STATUS ServiceStatus
Definition: thmsvc.c:21
HANDLE StopEvent
Definition: thmsvc.c:26
#define SERVICE_STOPPED
Definition: winsvc.h:21
#define SERVICE_CONTROL_SHUTDOWN
Definition: winsvc.h:40
#define SERVICE_PAUSED
Definition: winsvc.h:27
#define SERVICE_RUNNING
Definition: winsvc.h:24
#define SERVICE_CONTROL_CONTINUE
Definition: winsvc.h:38
#define SERVICE_CONTROL_STOP
Definition: winsvc.h:36
#define SERVICE_CONTROL_PAUSE
Definition: winsvc.h:37
#define SERVICE_CONTROL_INTERROGATE
Definition: winsvc.h:39

Referenced by ThemeServiceMain().

◆ ThemeServiceMain()

VOID WINAPI ThemeServiceMain ( DWORD  argc,
LPTSTR argv 
)

Definition at line 106 of file thmsvc.c.

107{
110
113 NULL);
115 {
116 ERR("RegisterServiceCtrlHandlerExW() failed! (Error %lu)\n", GetLastError());
117 return;
118 }
119
120 StartEvent = CreateEventW(NULL, TRUE, FALSE, L"Global\\ThemeStartEvent");
121 StopEvent = CreateEventW(NULL, TRUE, FALSE, L"Global\\ThemeStopEvent");
122
124
125 /* Signal the theme server in winlogon to install theme hooks */
128}
static int argc
Definition: ServiceArgs.c:12
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define argv
Definition: mplay32.c:18
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define L(x)
Definition: ntvdm.h:50
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext)
Definition: sctrl.c:812
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
static WCHAR ServiceName[]
Definition: thmsvc.c:18
static DWORD WINAPI ServiceControlHandler(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
Definition: thmsvc.c:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1040

◆ UpdateServiceStatus()

static VOID UpdateServiceStatus ( DWORD  dwState)
static

Definition at line 29 of file thmsvc.c.

30{
33
34 if (dwState == SERVICE_RUNNING)
36 else if (dwState == SERVICE_PAUSED)
38 else
40
44
45 if (dwState == SERVICE_START_PENDING ||
46 dwState == SERVICE_STOP_PENDING ||
47 dwState == SERVICE_PAUSE_PENDING ||
48 dwState == SERVICE_CONTINUE_PENDING)
50 else
52
55}
DWORD dwServiceType
Definition: winsvc.h:99
DWORD dwWin32ExitCode
Definition: winsvc.h:102
DWORD dwControlsAccepted
Definition: winsvc.h:101
DWORD dwWaitHint
Definition: winsvc.h:105
DWORD dwCurrentState
Definition: winsvc.h:100
DWORD dwCheckPoint
Definition: winsvc.h:104
DWORD dwServiceSpecificExitCode
Definition: winsvc.h:103
#define SERVICE_ACCEPT_STOP
Definition: winsvc.h:28
#define SERVICE_STOP_PENDING
Definition: winsvc.h:23
#define SERVICE_START_PENDING
Definition: winsvc.h:22
#define SERVICE_ACCEPT_PAUSE_CONTINUE
Definition: winsvc.h:29
#define SERVICE_ACCEPT_SHUTDOWN
Definition: winsvc.h:30
#define SERVICE_PAUSE_PENDING
Definition: winsvc.h:26
#define SERVICE_CONTINUE_PENDING
Definition: winsvc.h:25
#define SERVICE_WIN32_OWN_PROCESS
Definition: cmtypes.h:962

Referenced by ServiceControlHandler(), and ThemeServiceMain().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shsvcs  )

Variable Documentation

◆ ServiceName

WCHAR ServiceName[] = L"Themes"
static

Definition at line 18 of file thmsvc.c.

Referenced by ThemeServiceMain().

◆ ServiceStatus

SERVICE_STATUS ServiceStatus

Definition at line 21 of file thmsvc.c.

Referenced by ServiceControlHandler(), and UpdateServiceStatus().

◆ ServiceStatusHandle

SERVICE_STATUS_HANDLE ServiceStatusHandle

Definition at line 20 of file thmsvc.c.

Referenced by ServiceControlHandler(), ThemeServiceMain(), and UpdateServiceStatus().

◆ StartEvent

HANDLE StartEvent

Definition at line 26 of file thmsvc.c.

Referenced by CreateTestThread(), ServiceControlHandler(), and ThemeServiceMain().

◆ StopEvent

HANDLE StopEvent

Definition at line 26 of file thmsvc.c.

Referenced by ServiceControlHandler(), and ThemeServiceMain().