| 1 | /** | 
 
 
 
 
 | 2 | * This file has no copyright assigned and is placed in the Public Domain. | 
 
 
 
 
 | 3 | * This file is part of the mingw-w64 runtime package. | 
 
 
 
 
 | 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | 
 
 
 
 
 | 5 | */ | 
 
 
 
 
 | 6 | #ifndef _LMSVC_ | 
 
 
 
 
 | 7 | #define _LMSVC_ | 
 
 
 
 
 | 8 |  | 
 
 
 
 
 | 9 | #if __GNUC__ >= 3 | 
 
 
 
 
 | 10 | #pragma GCC system_header | 
 
 
 
 
 | 11 | #endif | 
 
 
 
 
 | 12 |  | 
 
 
 
 
 | 13 | #ifdef __cplusplus | 
 
 
 
 
 | 14 | extern "C" { | 
 
 
 
 
 | 15 | #endif | 
 
 
 
 
 | 16 |  | 
 
 
 
 
 | 17 | #include <lmsname.h> | 
 
 
 
 
 | 18 |  | 
 
 
 
 
 | 19 | typedef struct _SERVICE_INFO_0 { | 
 
 
 
 
 | 20 | LPWSTR svci0_name; | 
 
 
 
 
 | 21 | } SERVICE_INFO_0,*PSERVICE_INFO_0,*LPSERVICE_INFO_0; | 
 
 
 
 
 | 22 |  | 
 
 
 
 
 | 23 | typedef struct _SERVICE_INFO_1 { | 
 
 
 
 
 | 24 | LPWSTR svci1_name; | 
 
 
 
 
 | 25 | DWORD svci1_status; | 
 
 
 
 
 | 26 | DWORD svci1_code; | 
 
 
 
 
 | 27 | DWORD svci1_pid; | 
 
 
 
 
 | 28 | } SERVICE_INFO_1,*PSERVICE_INFO_1,*LPSERVICE_INFO_1; | 
 
 
 
 
 | 29 |  | 
 
 
 
 
 | 30 | typedef struct _SERVICE_INFO_2 { | 
 
 
 
 
 | 31 | LPWSTR svci2_name; | 
 
 
 
 
 | 32 | DWORD svci2_status; | 
 
 
 
 
 | 33 | DWORD svci2_code; | 
 
 
 
 
 | 34 | DWORD svci2_pid; | 
 
 
 
 
 | 35 | LPWSTR svci2_text; | 
 
 
 
 
 | 36 | DWORD svci2_specific_error; | 
 
 
 
 
 | 37 | LPWSTR svci2_display_name; | 
 
 
 
 
 | 38 | } SERVICE_INFO_2,*PSERVICE_INFO_2,*LPSERVICE_INFO_2; | 
 
 
 
 
 | 39 |  | 
 
 
 
 
 | 40 | NET_API_STATUS WINAPI NetServiceControl(LPCWSTR servername,LPCWSTR service,DWORD opcode,DWORD arg,LPBYTE *bufptr); | 
 
 
 
 
 | 41 | NET_API_STATUS WINAPI NetServiceEnum(LPCWSTR servername,DWORD level,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD entriesread,LPDWORD totalentries,LPDWORD resume_handle); | 
 
 
 
 
 | 42 | NET_API_STATUS WINAPI NetServiceGetInfo(LPCWSTR servername,LPCWSTR service,DWORD level,LPBYTE *bufptr); | 
 
 
 
 
 | 43 | NET_API_STATUS WINAPI NetServiceInstall(LPCWSTR servername,LPCWSTR service,DWORD argc,LPCWSTR argv[],LPBYTE *bufptr); | 
 
 
 
 
 | 44 |  | 
 
 
 
 
 | 45 | #define SERVICE_INSTALL_STATE 0x03 | 
 
 
 
 
 | 46 | #define SERVICE_UNINSTALLED 0x00 | 
 
 
 
 
 | 47 | #define SERVICE_INSTALL_PENDING 0x01 | 
 
 
 
 
 | 48 | #define SERVICE_UNINSTALL_PENDING 0x02 | 
 
 
 
 
 | 49 | #define SERVICE_INSTALLED 0x03 | 
 
 
 
 
 | 50 |  | 
 
 
 
 
 | 51 | #define SERVICE_PAUSE_STATE 0x0C | 
 
 
 
 
 | 52 | #define LM20_SERVICE_ACTIVE 0x00 | 
 
 
 
 
 | 53 | #define LM20_SERVICE_CONTINUE_PENDING 0x04 | 
 
 
 
 
 | 54 | #define LM20_SERVICE_PAUSE_PENDING 0x08 | 
 
 
 
 
 | 55 | #define LM20_SERVICE_PAUSED 0x0C | 
 
 
 
 
 | 56 |  | 
 
 
 
 
 | 57 | #define SERVICE_NOT_UNINSTALLABLE 0x00 | 
 
 
 
 
 | 58 | #define SERVICE_UNINSTALLABLE 0x10 | 
 
 
 
 
 | 59 |  | 
 
 
 
 
 | 60 | #define SERVICE_NOT_PAUSABLE 0x00 | 
 
 
 
 
 | 61 | #define SERVICE_PAUSABLE 0x20 | 
 
 
 
 
 | 62 |  | 
 
 
 
 
 | 63 | #define SERVICE_REDIR_PAUSED 0x700 | 
 
 
 
 
 | 64 | #define SERVICE_REDIR_DISK_PAUSED 0x100 | 
 
 
 
 
 | 65 | #define SERVICE_REDIR_PRINT_PAUSED 0x200 | 
 
 
 
 
 | 66 | #define SERVICE_REDIR_COMM_PAUSED 0x400 | 
 
 
 
 
 | 67 |  | 
 
 
 
 
 | 68 | #define SERVICE_DOS_ENCRYPTION L"ENCRYPT" | 
 
 
 
 
 | 69 |  | 
 
 
 
 
 | 70 | #define SERVICE_CTRL_INTERROGATE 0 | 
 
 
 
 
 | 71 | #define SERVICE_CTRL_PAUSE 1 | 
 
 
 
 
 | 72 | #define SERVICE_CTRL_CONTINUE 2 | 
 
 
 
 
 | 73 | #define SERVICE_CTRL_UNINSTALL 3 | 
 
 
 
 
 | 74 |  | 
 
 
 
 
 | 75 | #define SERVICE_CTRL_REDIR_DISK 0x1 | 
 
 
 
 
 | 76 | #define SERVICE_CTRL_REDIR_PRINT 0x2 | 
 
 
 
 
 | 77 | #define SERVICE_CTRL_REDIR_COMM 0x4 | 
 
 
 
 
 | 78 |  | 
 
 
 
 
 | 79 | #define SERVICE_IP_NO_HINT 0x0 | 
 
 
 
 
 | 80 | #define SERVICE_CCP_NO_HINT 0x0 | 
 
 
 
 
 | 81 |  | 
 
 
 
 
 | 82 | #define SERVICE_IP_QUERY_HINT 0x10000 | 
 
 
 
 
 | 83 | #define SERVICE_CCP_QUERY_HINT 0x10000 | 
 
 
 
 
 | 84 |  | 
 
 
 
 
 | 85 | #define SERVICE_IP_CHKPT_NUM 0x0FF | 
 
 
 
 
 | 86 | #define SERVICE_CCP_CHKPT_NUM 0x0FF | 
 
 
 
 
 | 87 |  | 
 
 
 
 
 | 88 | #define SERVICE_IP_WAIT_TIME 0x0FF00 | 
 
 
 
 
 | 89 | #define SERVICE_CCP_WAIT_TIME 0x0FF00 | 
 
 
 
 
 | 90 |  | 
 
 
 
 
 | 91 | #define SERVICE_IP_WAITTIME_SHIFT 8 | 
 
 
 
 
 | 92 | #define SERVICE_NTIP_WAITTIME_SHIFT 12 | 
 
 
 
 
 | 93 |  | 
 
 
 
 
 | 94 | #define UPPER_HINT_MASK 0x0000FF00 | 
 
 
 
 
 | 95 | #define LOWER_HINT_MASK 0x000000FF | 
 
 
 
 
 | 96 | #define UPPER_GET_HINT_MASK 0x0FF00000 | 
 
 
 
 
 | 97 | #define LOWER_GET_HINT_MASK 0x0000FF00 | 
 
 
 
 
 | 98 | #define SERVICE_NT_MAXTIME 0x0000FFFF | 
 
 
 
 
 | 99 | #define SERVICE_RESRV_MASK 0x0001FFFF | 
 
 
 
 
 | 100 | #define SERVICE_MAXTIME 0x000000FF | 
 
 
 
 
 | 101 |  | 
 
 
 
 
 | 102 | #define SERVICE_BASE 3050 | 
 
 
 
 
 | 103 | #define SERVICE_UIC_NORMAL 0 | 
 
 
 
 
 | 104 |  | 
 
 
 
 
 | 105 | #define SERVICE_UIC_BADPARMVAL (SERVICE_BASE + 1) | 
 
 
 
 
 | 106 | #define SERVICE_UIC_MISSPARM (SERVICE_BASE + 2) | 
 
 
 
 
 | 107 | #define SERVICE_UIC_UNKPARM (SERVICE_BASE + 3) | 
 
 
 
 
 | 108 | #define SERVICE_UIC_RESOURCE (SERVICE_BASE + 4) | 
 
 
 
 
 | 109 | #define SERVICE_UIC_CONFIG (SERVICE_BASE + 5) | 
 
 
 
 
 | 110 | #define SERVICE_UIC_SYSTEM (SERVICE_BASE + 6) | 
 
 
 
 
 | 111 | #define SERVICE_UIC_INTERNAL (SERVICE_BASE + 7) | 
 
 
 
 
 | 112 | #define SERVICE_UIC_AMBIGPARM (SERVICE_BASE + 8) | 
 
 
 
 
 | 113 | #define SERVICE_UIC_DUPPARM (SERVICE_BASE + 9) | 
 
 
 
 
 | 114 | #define SERVICE_UIC_KILL (SERVICE_BASE + 10) | 
 
 
 
 
 | 115 | #define SERVICE_UIC_EXEC (SERVICE_BASE + 11) | 
 
 
 
 
 | 116 | #define SERVICE_UIC_SUBSERV (SERVICE_BASE + 12) | 
 
 
 
 
 | 117 | #define SERVICE_UIC_CONFLPARM (SERVICE_BASE + 13) | 
 
 
 
 
 | 118 | #define SERVICE_UIC_FILE (SERVICE_BASE + 14) | 
 
 
 
 
 | 119 |  | 
 
 
 
 
 | 120 | #define SERVICE_UIC_M_NULL 0 | 
 
 
 
 
 | 121 |  | 
 
 
 
 
 | 122 | #define SERVICE_UIC_M_MEMORY (SERVICE_BASE + 20) | 
 
 
 
 
 | 123 | #define SERVICE_UIC_M_DISK (SERVICE_BASE + 21) | 
 
 
 
 
 | 124 | #define SERVICE_UIC_M_THREADS (SERVICE_BASE + 22) | 
 
 
 
 
 | 125 | #define SERVICE_UIC_M_PROCESSES (SERVICE_BASE + 23) | 
 
 
 
 
 | 126 | #define SERVICE_UIC_M_SECURITY (SERVICE_BASE + 24) | 
 
 
 
 
 | 127 | #define SERVICE_UIC_M_LANROOT (SERVICE_BASE + 25) | 
 
 
 
 
 | 128 | #define SERVICE_UIC_M_REDIR (SERVICE_BASE + 26) | 
 
 
 
 
 | 129 | #define SERVICE_UIC_M_SERVER (SERVICE_BASE + 27) | 
 
 
 
 
 | 130 | #define SERVICE_UIC_M_SEC_FILE_ERR (SERVICE_BASE + 28) | 
 
 
 
 
 | 131 | #define SERVICE_UIC_M_FILES (SERVICE_BASE + 29) | 
 
 
 
 
 | 132 | #define SERVICE_UIC_M_LOGS (SERVICE_BASE + 30) | 
 
 
 
 
 | 133 | #define SERVICE_UIC_M_LANGROUP (SERVICE_BASE + 31) | 
 
 
 
 
 | 134 | #define SERVICE_UIC_M_MSGNAME (SERVICE_BASE + 32) | 
 
 
 
 
 | 135 | #define SERVICE_UIC_M_ANNOUNCE (SERVICE_BASE + 33) | 
 
 
 
 
 | 136 | #define SERVICE_UIC_M_UAS (SERVICE_BASE + 34) | 
 
 
 
 
 | 137 | #define SERVICE_UIC_M_SERVER_SEC_ERR (SERVICE_BASE + 35) | 
 
 
 
 
 | 138 | #define SERVICE_UIC_M_WKSTA (SERVICE_BASE + 37) | 
 
 
 
 
 | 139 | #define SERVICE_UIC_M_ERRLOG (SERVICE_BASE + 38) | 
 
 
 
 
 | 140 | #define SERVICE_UIC_M_FILE_UW (SERVICE_BASE + 39) | 
 
 
 
 
 | 141 | #define SERVICE_UIC_M_ADDPAK (SERVICE_BASE + 40) | 
 
 
 
 
 | 142 | #define SERVICE_UIC_M_LAZY (SERVICE_BASE + 41) | 
 
 
 
 
 | 143 | #define SERVICE_UIC_M_UAS_MACHINE_ACCT (SERVICE_BASE + 42) | 
 
 
 
 
 | 144 | #define SERVICE_UIC_M_UAS_SERVERS_NMEMB (SERVICE_BASE + 43) | 
 
 
 
 
 | 145 | #define SERVICE_UIC_M_UAS_SERVERS_NOGRP (SERVICE_BASE + 44) | 
 
 
 
 
 | 146 | #define SERVICE_UIC_M_UAS_INVALID_ROLE (SERVICE_BASE + 45) | 
 
 
 
 
 | 147 | #define SERVICE_UIC_M_NETLOGON_NO_DC (SERVICE_BASE + 46) | 
 
 
 
 
 | 148 | #define SERVICE_UIC_M_NETLOGON_DC_CFLCT (SERVICE_BASE + 47) | 
 
 
 
 
 | 149 | #define SERVICE_UIC_M_NETLOGON_AUTH (SERVICE_BASE + 48) | 
 
 
 
 
 | 150 | #define SERVICE_UIC_M_UAS_PROLOG (SERVICE_BASE + 49) | 
 
 
 
 
 | 151 |  | 
 
 
 
 
 | 152 | #define SERVICE2_BASE 5600 | 
 
 
 
 
 | 153 |  | 
 
 
 
 
 | 154 | #define SERVICE_UIC_M_NETLOGON_MPATH (SERVICE2_BASE + 0) | 
 
 
 
 
 | 155 | #define SERVICE_UIC_M_LSA_MACHINE_ACCT (SERVICE2_BASE + 1) | 
 
 
 
 
 | 156 | #define SERVICE_UIC_M_DATABASE_ERROR (SERVICE2_BASE + 2) | 
 
 
 
 
 | 157 |  | 
 
 
 
 
 | 158 | #define SERVICE_IP_CODE(tt,nn) ((__LONG32)SERVICE_IP_QUERY_HINT|(__LONG32)(nn|(tt<<SERVICE_IP_WAITTIME_SHIFT))) | 
 
 
 
 
 | 159 | #define SERVICE_CCP_CODE(tt,nn) ((__LONG32)SERVICE_CCP_QUERY_HINT|(__LONG32)(nn|(tt<<SERVICE_IP_WAITTIME_SHIFT))) | 
 
 
 
 
 | 160 | #define SERVICE_UIC_CODE(cc,mm) ((__LONG32)(((__LONG32)cc<<16)|(__LONG32)(unsigned short)mm)) | 
 
 
 
 
 | 161 | #define SERVICE_NT_CCP_CODE(tt,nn) (((__LONG32)SERVICE_CCP_QUERY_HINT) | ((__LONG32)(nn)) | (((tt)&LOWER_HINT_MASK) << SERVICE_IP_WAITTIME_SHIFT) | (((tt)&UPPER_HINT_MASK) << SERVICE_NTIP_WAITTIME_SHIFT)) | 
 
 
 
 
 | 162 | #define SERVICE_NT_WAIT_GET(code) ((((code) & UPPER_GET_HINT_MASK) >> SERVICE_NTIP_WAITTIME_SHIFT) | (((code) & LOWER_GET_HINT_MASK) >> SERVICE_IP_WAITTIME_SHIFT)) | 
 
 
 
 
 | 163 |  | 
 
 
 
 
 | 164 | #ifdef __cplusplus | 
 
 
 
 
 | 165 | } | 
 
 
 
 
 | 166 | #endif | 
 
 
 
 
 | 167 | #endif |