Differences From Artifact [59233b3c2f66ba16]:
- File        
src/win32/winsvc.d
- 2015-04-21 10:46:55 - part of checkin [4e2933c620] on branch trunk - Rebased to the latest verson dmd 2.067. Not yet verified the outcome. (user: kinaba) [annotate]
 
 
To Artifact [1045de9392b75c75]:
- File        
src/win32/winsvc.d
- 
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate] 
 - 
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
 
    5  *                                                                       *              5  *                                                                       *
    6  *                 Translated from MinGW Windows headers                 *              6  *                 Translated from MinGW Windows headers                 *
    7  *                           by Stewart Gordon                           *              7  *                           by Stewart Gordon                           *
    8  *                                                                       *              8  *                                                                       *
    9  *                       Placed into public domain                       *              9  *                       Placed into public domain                       *
   10  \***********************************************************************/             10  \***********************************************************************/
   11  module win32.winsvc;                                                                  11  module win32.winsvc;
   12  pragma(lib, "advapi32.lib");                                                     |    12  pragma(lib, "advapi32");
   13                                                                                        13  
   14  private import win32.w32api, win32.windef;                                            14  private import win32.w32api, win32.windef;
   15                                                                                   <
   16  static assert (_WIN32_WINNT_ONLY,                                                <
   17          "win32.winsvc is available only if version WindowsNTonly, WindowsXP, "   <
   18          "Windows2003 or WindowsVista is set");                                   <
   19                                                                                   <
   20                                                                                        15  
   21  // FIXME: check Windows version support                                               16  // FIXME: check Windows version support
   22                                                                                        17  
   23  const TCHAR[]                                                                         18  const TCHAR[]
   24          SERVICES_ACTIVE_DATABASE = "ServicesActive",                                  19          SERVICES_ACTIVE_DATABASE = "ServicesActive",
   25          SERVICES_FAILED_DATABASE = "ServicesFailed";                                  20          SERVICES_FAILED_DATABASE = "ServicesFailed";
   26                                                                                        21  
................................................................................................................................................................................
  183                                                                                       178  
  184  struct SERVICE_TABLE_ENTRYW {                                                        179  struct SERVICE_TABLE_ENTRYW {
  185          LPWSTR                   lpServiceName;                                      180          LPWSTR                   lpServiceName;
  186          LPSERVICE_MAIN_FUNCTIONW lpServiceProc;                                      181          LPSERVICE_MAIN_FUNCTIONW lpServiceProc;
  187  }                                                                                    182  }
  188  alias SERVICE_TABLE_ENTRYW* LPSERVICE_TABLE_ENTRYW;                                  183  alias SERVICE_TABLE_ENTRYW* LPSERVICE_TABLE_ENTRYW;
  189                                                                                       184  
  190  alias HANDLE SC_HANDLE;                                                          |   185  mixin DECLARE_HANDLE!("SC_HANDLE");
  191  alias HANDLE* LPSC_HANDLE;                                                       |   186  alias SC_HANDLE* LPSC_HANDLE;
  192  alias void* SC_LOCK;                                                                 187  alias void* SC_LOCK;
  193  alias DWORD SERVICE_STATUS_HANDLE;                                               |   188  mixin DECLARE_HANDLE!("SERVICE_STATUS_HANDLE");
  194                                                                                       189  
  195  extern (Windows) {                                                                   190  extern (Windows) {
  196          alias void function(DWORD) LPHANDLER_FUNCTION;                               191          alias void function(DWORD) LPHANDLER_FUNCTION;
  197          alias DWORD function(DWORD, DWORD, LPVOID, LPVOID) LPHANDLER_FUNCTION_EX     192          alias DWORD function(DWORD, DWORD, LPVOID, LPVOID) LPHANDLER_FUNCTION_EX
  198  }                                                                                    193  }
  199                                                                                       194  
  200  static if (_WIN32_WINNT >= 0x500) {                                                  195  static if (_WIN32_WINNT >= 0x500) {