"Fossies" - the Fresh Open Source Software Archive

Member "dmd2/src/druntime/src/core/sys/windows/lmsvc.d" (20 Nov 2020, 5832 Bytes) of package /linux/misc/dmd.2.094.2.linux.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) D source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * Windows API header module
    3  *
    4  * Translated from MinGW Windows headers
    5  *
    6  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
    7  * Source: $(DRUNTIMESRC src/core/sys/windows/_lmsvc.d)
    8  */
    9 module core.sys.windows.lmsvc;
   10 version (Windows):
   11 @system:
   12 
   13 // FIXME: Is this file deprecated? All of the functions are only for Win16.
   14 /**
   15   Changes relative to MinGW:
   16   lmsname is not imported publicly (instead, core.sys.windows.lm imports it directly).
   17 */
   18 // TODO: 5 macros
   19 
   20 private import core.sys.windows.lmcons, core.sys.windows.lmsname, core.sys.windows.windef;
   21 
   22 const TCHAR[] SERVICE_DOS_ENCRYPTION = "ENCRYPT";
   23 
   24 enum SERVICE_UNINSTALLED=0;
   25 enum SERVICE_INSTALL_PENDING=1;
   26 enum SERVICE_UNINSTALL_PENDING=2;
   27 enum SERVICE_INSTALLED=3;
   28 enum SERVICE_INSTALL_STATE=3;
   29 enum SERVICE_PAUSE_STATE=18;
   30 enum LM20_SERVICE_ACTIVE=0;
   31 enum LM20_SERVICE_CONTINUE_PENDING=4;
   32 enum LM20_SERVICE_PAUSE_PENDING=8;
   33 enum LM20_SERVICE_PAUSED=18;
   34 enum SERVICE_NOT_UNINSTALLABLE=0;
   35 enum SERVICE_UNINSTALLABLE=16;
   36 enum SERVICE_NOT_PAUSABLE=0;
   37 enum SERVICE_PAUSABLE=32;
   38 enum SERVICE_REDIR_PAUSED=0x700;
   39 enum SERVICE_REDIR_DISK_PAUSED=256;
   40 enum SERVICE_REDIR_PRINT_PAUSED=512;
   41 enum SERVICE_REDIR_COMM_PAUSED=1024;
   42 enum SERVICE_CTRL_INTERROGATE=0;
   43 enum SERVICE_CTRL_PAUSE=1;
   44 enum SERVICE_CTRL_CONTINUE=2;
   45 enum SERVICE_CTRL_UNINSTALL=3;
   46 enum SERVICE_CTRL_REDIR_DISK=1;
   47 enum SERVICE_CTRL_REDIR_PRINT=2;
   48 enum SERVICE_CTRL_REDIR_COMM=4;
   49 enum SERVICE_IP_NO_HINT=0;
   50 enum SERVICE_CCP_NO_HINT=0;
   51 enum SERVICE_IP_QUERY_HINT=0x10000;
   52 enum SERVICE_CCP_QUERY_HINT=0x10000;
   53 enum SERVICE_IP_CHKPT_NUM=255;
   54 enum SERVICE_CCP_CHKPT_NUM=255;
   55 enum SERVICE_IP_WAIT_TIME=0xFF00;
   56 enum SERVICE_CCP_WAIT_TIME=0xFF00;
   57 enum SERVICE_IP_WAITTIME_SHIFT=8;
   58 enum SERVICE_NTIP_WAITTIME_SHIFT=12;
   59 enum UPPER_HINT_MASK=0xFF00;
   60 enum LOWER_HINT_MASK=255;
   61 enum UPPER_GET_HINT_MASK=0xFF00000;
   62 enum LOWER_GET_HINT_MASK=0xFF00;
   63 enum SERVICE_NT_MAXTIME=0xFFFF;
   64 enum SERVICE_RESRV_MASK=0x1FFFF;
   65 enum SERVICE_MAXTIME=255;
   66 enum SERVICE_BASE=3050;
   67 enum SERVICE_UIC_NORMAL=0;
   68 
   69 enum SERVICE_UIC_BADPARMVAL = SERVICE_BASE+1;
   70 enum SERVICE_UIC_MISSPARM = SERVICE_BASE+2;
   71 enum SERVICE_UIC_UNKPARM = SERVICE_BASE+3;
   72 enum SERVICE_UIC_RESOURCE = SERVICE_BASE+4;
   73 enum SERVICE_UIC_CONFIG = SERVICE_BASE+5;
   74 enum SERVICE_UIC_SYSTEM = SERVICE_BASE+6;
   75 enum SERVICE_UIC_INTERNAL = SERVICE_BASE+7;
   76 enum SERVICE_UIC_AMBIGPARM = SERVICE_BASE+8;
   77 enum SERVICE_UIC_DUPPARM = SERVICE_BASE+9;
   78 enum SERVICE_UIC_KILL = SERVICE_BASE+10;
   79 enum SERVICE_UIC_EXEC = SERVICE_BASE+11;
   80 enum SERVICE_UIC_SUBSERV = SERVICE_BASE+12;
   81 enum SERVICE_UIC_CONFLPARM = SERVICE_BASE+13;
   82 enum SERVICE_UIC_FILE = SERVICE_BASE+14;
   83 enum SERVICE_UIC_M_NULL=0;
   84 enum SERVICE_UIC_M_MEMORY = SERVICE_BASE+20;
   85 enum SERVICE_UIC_M_DISK = SERVICE_BASE+21;
   86 enum SERVICE_UIC_M_THREADS = SERVICE_BASE+22;
   87 enum SERVICE_UIC_M_PROCESSES = SERVICE_BASE+23;
   88 enum SERVICE_UIC_M_SECURITY = SERVICE_BASE+24;
   89 enum SERVICE_UIC_M_LANROOT = SERVICE_BASE+25;
   90 enum SERVICE_UIC_M_REDIR = SERVICE_BASE+26;
   91 enum SERVICE_UIC_M_SERVER = SERVICE_BASE+27;
   92 enum SERVICE_UIC_M_SEC_FILE_ERR = SERVICE_BASE+28;
   93 enum SERVICE_UIC_M_FILES = SERVICE_BASE+29;
   94 enum SERVICE_UIC_M_LOGS = SERVICE_BASE+30;
   95 enum SERVICE_UIC_M_LANGROUP = SERVICE_BASE+31;
   96 enum SERVICE_UIC_M_MSGNAME = SERVICE_BASE+32;
   97 enum SERVICE_UIC_M_ANNOUNCE = SERVICE_BASE+33;
   98 enum SERVICE_UIC_M_UAS = SERVICE_BASE+34;
   99 enum SERVICE_UIC_M_SERVER_SEC_ERR = SERVICE_BASE+35;
  100 enum SERVICE_UIC_M_WKSTA = SERVICE_BASE+37;
  101 enum SERVICE_UIC_M_ERRLOG = SERVICE_BASE+38;
  102 enum SERVICE_UIC_M_FILE_UW = SERVICE_BASE+39;
  103 enum SERVICE_UIC_M_ADDPAK = SERVICE_BASE+40;
  104 enum SERVICE_UIC_M_LAZY = SERVICE_BASE+41;
  105 enum SERVICE_UIC_M_UAS_MACHINE_ACCT = SERVICE_BASE+42;
  106 enum SERVICE_UIC_M_UAS_SERVERS_NMEMB = SERVICE_BASE+43;
  107 enum SERVICE_UIC_M_UAS_SERVERS_NOGRP = SERVICE_BASE+44;
  108 enum SERVICE_UIC_M_UAS_INVALID_ROLE = SERVICE_BASE+45;
  109 enum SERVICE_UIC_M_NETLOGON_NO_DC = SERVICE_BASE+46;
  110 enum SERVICE_UIC_M_NETLOGON_DC_CFLCT = SERVICE_BASE+47;
  111 enum SERVICE_UIC_M_NETLOGON_AUTH = SERVICE_BASE+48;
  112 enum SERVICE_UIC_M_UAS_PROLOG = SERVICE_BASE+49;
  113 enum SERVICE2_BASE=5600;
  114 enum SERVICE_UIC_M_NETLOGON_MPATH = SERVICE2_BASE+0;
  115 enum SERVICE_UIC_M_LSA_MACHINE_ACCT = SERVICE2_BASE+1;
  116 enum SERVICE_UIC_M_DATABASE_ERROR = SERVICE2_BASE+2;
  117 
  118 struct SERVICE_INFO_0 {
  119     LPWSTR svci0_name;
  120 }
  121 alias SERVICE_INFO_0* PSERVICE_INFO_0, LPSERVICE_INFO_0;
  122 
  123 struct SERVICE_INFO_1 {
  124     LPWSTR svci1_name;
  125     DWORD svci1_status;
  126     DWORD svci1_code;
  127     DWORD svci1_pid;
  128 }
  129 alias SERVICE_INFO_1* PSERVICE_INFO_1, LPSERVICE_INFO_1;
  130 
  131 struct SERVICE_INFO_2 {
  132     LPWSTR svci2_name;
  133     DWORD svci2_status;
  134     DWORD svci2_code;
  135     DWORD svci2_pid;
  136     LPWSTR svci2_text;
  137     DWORD svci2_specific_error;
  138     LPWSTR svci2_display_name;
  139 }
  140 alias SERVICE_INFO_2* PSERVICE_INFO_2, LPSERVICE_INFO_2;
  141 
  142 extern (Windows) {
  143     deprecated {
  144         NET_API_STATUS NetServiceControl(LPCWSTR, LPCWSTR, DWORD, DWORD,
  145           PBYTE*);
  146         NET_API_STATUS NetServiceEnum(LPCWSTR, DWORD, PBYTE*, DWORD, PDWORD,
  147           PDWORD, PDWORD);
  148         NET_API_STATUS NetServiceGetInfo(LPCWSTR, LPCWSTR, DWORD, PBYTE*);
  149         NET_API_STATUS NetServiceInstall(LPCWSTR, LPCWSTR, DWORD, LPCWSTR*,
  150           PBYTE*);
  151     }
  152 }
  153 //MACRO #define SERVICE_IP_CODE(t, n) ((long)SERVICE_IP_QUERY_HINT|(long)(n|(t<<SERVICE_IP_WAITTIME_SHIFT)))
  154 //MACRO #define SERVICE_CCP_CODE(t, n) ((long)SERVICE_CCP_QUERY_HINT|(long)(n|(t<<SERVICE_IP_WAITTIME_SHIFT)))
  155 //MACRO #define SERVICE_UIC_CODE(c, m) ((long)(((long)c<<16)|(long)(USHORT)m))
  156 //MACRO #define SERVICE_NT_CCP_CODE(t, n) (((long)SERVICE_CCP_QUERY_HINT)|((long)(n))|(((t)&LOWER_HINT_MASK)<<SERVICE_IP_WAITTIME_SHIFT)|(((t)&UPPER_HINT_MASK)<<SERVICE_NTIP_WAITTIME_SHIFT))
  157 //MACRO #define SERVICE_NT_WAIT_GET(c) ((((c)&UPPER_GET_HINT_MASK)>>SERVICE_NTIP_WAITTIME_SHIFT)|(((c)&LOWER_GET_HINT_MASK)>>SERVICE_IP_WAITTIME_SHIFT))