2 * Services.exe - include file
4 * Copyright 2007 Google (Mikolaj Zalewski)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef WINE_PROGRAMS_UTILS_H_
22 #define WINE_PROGRAMS_UTILS_H_
24 #include "wine/list.h"
29 LONG ref_count; /* number of references - if goes to zero and the service is deleted the structure will be freed */
31 SERVICE_STATUS_PROCESS status;
32 QUERY_SERVICE_CONFIGW config;
34 LPWSTR dependOnServices;
35 LPWSTR dependOnGroups;
38 BOOL validate_service_name(LPCWSTR name);
39 BOOL validate_service_config(struct service_entry *entry);
40 struct service_entry *find_service(LPCWSTR name);
41 struct service_entry *find_service_by_displayname(LPCWSTR name);
42 DWORD add_service(struct service_entry *entry);
43 DWORD remove_service(struct service_entry *entry);
44 DWORD save_service_config(struct service_entry *entry);
45 void free_service_entry(struct service_entry *entry);
46 void release_service(struct service_entry *service);
48 void lock_services(void);
49 void unlock_services(void);
51 extern HANDLE g_hStartedEvent;
53 DWORD RPC_MainLoop(void);
56 LPWSTR strdupW(LPCWSTR str);
58 BOOL check_multisz(LPCWSTR lpMultiSz, DWORD cbSize);
60 DWORD load_reg_string(HKEY hKey, LPCWSTR szValue, BOOL bExpand, LPWSTR *output);
61 DWORD load_reg_multisz(HKEY hKey, LPCWSTR szValue, LPWSTR *output);
62 DWORD load_reg_dword(HKEY hKey, LPCWSTR szValue, DWORD *output);
64 static inline LPCWSTR get_display_name(struct service_entry *service)
66 return service->config.lpDisplayName ? service->config.lpDisplayName : service->name;
69 static inline BOOL is_marked_for_delete(struct service_entry *service)
71 return service->entry.next == NULL;
74 #endif /*WINE_PROGRAMS_UTILS_H_*/