ReactOS  0.4.15-dev-1206-g731eddf
precomp.h
Go to the documentation of this file.
1 #ifndef __SERVMAN_PRECOMP_H
2 #define __SERVMAN_PRECOMP_H
3 
4 #define WIN32_NO_STATUS
5 #define _INC_WINDOWS
6 #define COM_NO_WINDOWS_H
7 
8 #include <windef.h>
9 #include <winbase.h>
10 #include <winerror.h>
11 #include <wingdi.h>
12 #include <winsvc.h>
13 #include <wincon.h>
14 
15 #include <shlobj.h>
16 #include <commdlg.h>
17 #include <strsafe.h>
18 #include <process.h>
19 
20 #include "resource.h"
21 
22 #ifdef _MSC_VER
23 #pragma warning(disable : 4100)
24 #endif
25 
26 #define NO_ITEM_SELECTED -1
27 #define MAX_KEY_LENGTH 256
28 
29 #define LVNAME 0
30 #define LVDESC 1
31 #define LVSTATUS 2
32 #define LVSTARTUP 3
33 #define LVLOGONAS 4
34 
35 #define IMAGE_UNKNOWN 0
36 #define IMAGE_SERVICE 1
37 #define IMAGE_DRIVER 2
38 
39 #define ACTION_START 1
40 #define ACTION_STOP 2
41 #define ACTION_PAUSE 3
42 #define ACTION_RESUME 4
43 #define ACTION_RESTART 5
44 
45 #define ORD_ASCENDING 1
46 #define ORD_DESCENDING -1
47 
48 typedef struct _MAIN_WND_INFO
49 {
56  int nCmdShow;
57 
61 
62  INT SelectedItem;/* selection number in the list view */
65 
69 
71 
73 
74 
79 
80 
81 /* servman.c */
82 extern HINSTANCE hInstance;
83 extern HANDLE ProcessHeap;
84 
85 /* mainwnd.c */
86 typedef struct _MENU_HINT
87 {
91 
97 HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow);
98 
99 /* listview.c */
100 VOID SetListViewStyle(HWND hListView, DWORD View);
103 
104 /* start / stop / control */
105 DWORD DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams);
108 
109 /* progress.c */
110 #define DEFAULT_STEP 0
112 VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos);
113 VOID CompleteProgressBar(HANDLE hProgress);
114 
115 /* query.c */
118 BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPWSTR lpServiceName, LPWSTR lpPassword);
119 LPWSTR GetServiceDescription(LPWSTR lpServiceName);
120 BOOL SetServiceDescription(LPWSTR lpServiceName, LPWSTR lpDescription);
121 LPWSTR GetExecutablePath(LPWSTR lpServiceName);
126 
127 /* propsheet.c */
128 typedef struct _SERVICEPROPSHEET
129 {
132 
134 
135 typedef struct _DEPENDDATA
136 {
142 
144 
145 
146 HTREEITEM AddItemToTreeView(HWND hTreeView, HTREEITEM hRoot, LPWSTR lpDisplayName, LPWSTR lpServiceName, ULONG serviceType, BOOL bHasChildren);
147 
148 /* stop_dependencies */
150 LPWSTR GetListOfServicesToStop(LPWSTR lpServiceName);
151 BOOL
154 LPWSTR DisplayName,
155 LPWSTR ServiceList);
156 
157 /* tv1_dependencies */
158 BOOL TV1_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
159 VOID TV1_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
160 
161 /* tv2_dependencies */
162 BOOL TV2_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
163 VOID TV2_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
164 BOOL TV2_HasDependantServices(LPWSTR lpServiceName);
165 LPENUM_SERVICE_STATUS TV2_GetDependants(LPWSTR lpServiceName, LPDWORD lpdwCount);
166 
168 
169 /* propsheet window procs */
171  UINT uMsg,
172  WPARAM wParam,
173  LPARAM lParam);
175  UINT uMsg,
176  WPARAM wParam,
177  LPARAM lParam);
179  UINT uMsg,
180  WPARAM wParam,
181  LPARAM lParam);
183  UINT uMsg,
184  WPARAM wParam,
185  LPARAM lParam);
186 
187 /* export.c */
189 
190 /* misc.c */
191 INT AllocAndLoadString(OUT LPWSTR *lpTarget,
193  IN UINT uID);
195  IN UINT uID,
196  OUT LPWSTR *lpTarget,
197  ...);
199  IN INT PartId,
201  IN UINT uID,
202  ...);
204  IN INT PartId,
206  IN UINT uID);
207 INT GetTextFromEdit(OUT LPWSTR lpString,
208  IN HWND hDlg,
209  IN UINT Res);
212 HIMAGELIST InitImageList(UINT StartResource,
213  UINT EndResource,
214  UINT Width,
215  UINT Height,
216  ULONG type);
217 VOID
220  HWND hwnd,
221  UINT uType,
222  UINT uCaptionId,
223  UINT uMessageId);
224 
225 #endif /* __SERVMAN_PRECOMP_H */
INT_PTR CALLBACK StopDependsDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
HINSTANCE hInstance
Definition: charmap.c:20
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL CreateStopDependsDialog(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, LPWSTR ServiceList)
#define IN
Definition: typedefs.h:39
Definition: tftpd.h:59
VOID OpenPropSheet(PMAIN_WND_INFO Info)
Definition: propsheet.c:30
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: create.c:218
LPWSTR GetExecutablePath(LPWSTR lpServiceName)
UINT HintId
Definition: precomp.h:89
LPWSTR GetServiceDescription(LPWSTR lpServiceName)
Definition: query.c:135
BOOL TV2_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName)
DWORD DoControlService(LPWSTR ServiceName, HWND hProgress, DWORD Control)
Definition: control.c:18
DWORD DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams)
Definition: start.c:18
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:372
HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow)
Definition: mainwnd.c:925
#define CALLBACK
Definition: compat.h:35
ENUM_SERVICE_STATUS_PROCESS * GetSelectedService(PMAIN_WND_INFO Info)
Definition: query.c:13
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL SetServiceDescription(LPWSTR lpServiceName, LPWSTR lpDescription)
Definition: query.c:210
UINT_PTR WPARAM
Definition: windef.h:207
INT GetTextFromEdit(OUT LPWSTR lpString, IN HWND hDlg, IN UINT Res)
Definition: misc.c:174
HINSTANCE hInst
Definition: dxdiag.c:13
uint16_t * PWCHAR
Definition: typedefs.h:56
HIMAGELIST hDependsImageList
Definition: precomp.h:138
VOID GetError(VOID)
Definition: misc.c:192
VOID ExportFile(PMAIN_WND_INFO Info)
Definition: export.c:98
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
HWND hStatus
Definition: precomp.h:52
WPARAM wParam
Definition: combotst.c:138
DWORD DoStopService(LPWSTR ServiceName, HANDLE hProgress)
struct TraceInfo Info
INT SelectedItem
Definition: precomp.h:62
INT SortSelection
Definition: precomp.h:63
DWORD NumServices
Definition: precomp.h:60
BOOL CreateListView(PMAIN_WND_INFO Info)
Definition: listview.c:355
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
BOOL bInMenuLoop
Definition: precomp.h:67
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
unsigned int BOOL
Definition: ntddk_ex.h:94
static HTREEITEM hRoot
Definition: treeview.c:381
INT_PTR CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: delete.c:57
PSERVICEPROPSHEET pDlgInfo
Definition: precomp.h:137
INT AllocAndLoadString(OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:50
WORD CmdId
Definition: precomp.h:88
VOID TV1_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName)
LONG_PTR LPARAM
Definition: windef.h:208
HWND hDependsTreeView2
Definition: precomp.h:141
int nCmdShow
Definition: precomp.h:56
LPENUM_SERVICE_STATUS TV2_GetDependants(LPWSTR lpServiceName, LPDWORD lpdwCount)
INT SortDirection
Definition: precomp.h:64
ENUM_SERVICE_STATUS_PROCESS * pAllServices
Definition: precomp.h:58
LPTSTR ServiceName
Definition: ServiceMain.c:15
BOOL TV2_HasDependantServices(LPWSTR lpServiceName)
BOOL GetServiceList(PMAIN_WND_INFO Info)
Definition: query.c:279
VOID DisplayString(PWCHAR)
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
struct _DEPENDDATA DEPENDDATA
struct _MAIN_WND_INFO * PMAIN_WND_INFO
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hStatusBar
Definition: main.cpp:35
PVOID pTag
Definition: precomp.h:70
BOOL StatusBarLoadString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID)
Definition: misc.c:150
CHAR Message[80]
Definition: alive.c:5
HWND hDependsTreeView1
Definition: precomp.h:140
DWORD LoadAndFormatString(IN HINSTANCE hInstance, IN UINT uID, OUT LPTSTR *lpTarget,...)
Definition: misc.c:86
HWND hTool
Definition: precomp.h:53
LPQUERY_SERVICE_CONFIG GetServiceConfig(LPWSTR lpServiceName)
Definition: query.c:29
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
INT_PTR CALLBACK LogonPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: about.c:4
struct _MENU_HINT MENU_HINT
HMENU hShortcutMenu
Definition: precomp.h:55
BOOL StatusBarLoadAndFormatString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID,...)
Definition: misc.c:108
struct _SERVICEPROPSHEET SERVICEPROPSHEET
static const WCHAR Control[]
Definition: interface.c:27
HANDLE ProcessHeap
Definition: servman.c:15
BOOL TV1_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName)
VOID TV2_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName)
VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos)
Definition: progress.c:338
BOOL bIsUserAnAdmin
Definition: precomp.h:68
INT_PTR CALLBACK RecoveryPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPWSTR lpServiceName, LPWSTR lpPassword)
Definition: query.c:82
struct _DEPENDDATA * PDEPENDDATA
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
VOID ResourceMessageBox(HINSTANCE hInstance, HWND hwnd, UINT uType, UINT uCaptionId, UINT uMessageId)
Definition: misc.c:283
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:131
ENUM_SERVICE_STATUS_PROCESS * pCurrentService
Definition: precomp.h:59
HWND hMainWnd
Definition: precomp.h:50
unsigned int UINT
Definition: ndis.h:50
HWND hDependsWnd
Definition: precomp.h:139
VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info)
Definition: mainwnd.c:152
struct _MAIN_WND_INFO MAIN_WND_INFO
VOID CompleteProgressBar(HANDLE hProgress)
Definition: progress.c:311
HWND hHeader
Definition: precomp.h:54
BOOL RefreshServiceList(PMAIN_WND_INFO Info)
Definition: listview.c:247
BOOL InitMainWindowImpl(VOID)
Definition: mainwnd.c:966
BOOL bDlgOpen
Definition: precomp.h:66
#define OUT
Definition: typedefs.h:40
INT_PTR CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: progress.c:281
uint32_t * LPDWORD
Definition: typedefs.h:59
LPWSTR GetListOfServicesToStop(LPWSTR lpServiceName)
INT_PTR CALLBACK DependenciesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
unsigned int ULONG
Definition: retypes.h:1
struct _MENU_HINT * PMENU_HINT
HTREEITEM AddItemToTreeView(HWND hTreeView, HTREEITEM hRoot, LPWSTR lpDisplayName, LPWSTR lpServiceName, ULONG serviceType, BOOL bHasChildren)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
VOID ListViewSelectionChanged(PMAIN_WND_INFO Info, LPNMLISTVIEW pnmv)
Definition: listview.c:48
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
Definition: winbase.h:2753
LPARAM lParam
Definition: combotst.c:139
PMAIN_WND_INFO Info
Definition: precomp.h:130
VOID SetListViewStyle(HWND hListView, DWORD View)
Definition: listview.c:34
VOID UpdateServiceCount(PMAIN_WND_INFO Info)
Definition: mainwnd.c:125
VOID UninitMainWindowImpl(VOID)
Definition: mainwnd.c:992
HWND hListView
Definition: precomp.h:51
VOID FreeServiceList(PMAIN_WND_INFO Info)
Definition: query.c:257
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219