www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - service.d -- a skeletal service for Windows

reply "Gifford Hesketh" <gifford.hesketh savvis.net> writes:
/*
** service.d -- a skeletal service for Windows
**
** Created 2004-May-27 for the public domain by Gifford Hesketh  (
first.last gmail.com )
*/
import winbase;
import winerror;
import winnt;
import winsvc;

extern ( Windows )
{

char * theServiceName = "service.d";

int main ( char[][] args )
{
 SERVICE_TABLE_ENTRY[] theServiceTable;
 theServiceTable.length = 2;

 theServiceTable[ 0 ].lpServiceName = theServiceName;
 theServiceTable[ 0 ].lpServiceProc = & ( ServiceMain );
 theServiceTable[ 1 ].lpServiceName = null;
 theServiceTable[ 1 ].lpServiceProc = null;

 if ( ! ( StartServiceCtrlDispatcher ( theServiceTable ) ) )
 {
  /*
  ** probably (?) run from the command line
  */
  void * theSCM;

  OutputDebugString ( "! StartServiceCtrlDispatcher" );

  theSCM = OpenSCManager ( null, null, SC_MANAGER_CREATE_SERVICE | DELETE );

  if ( cast ( SC_HANDLE ) 0 != theSCM )
  {
   void * theService;

   theService = OpenService ( theSCM, theServiceName, DELETE );

   if ( cast ( SC_HANDLE ) 0 != theService )
   {
    /*
    ** service exists; delete it
    */
    if ( DeleteService ( theService ) )
    {
     OutputDebugString ( ". DeleteService" );
    }
    else
    {
     OutputDebugString ( "! DeleteService" );
    }

    CloseServiceHandle ( theService );
   }
   else
   {
    if ( ERROR_SERVICE_DOES_NOT_EXIST == GetLastError () )
    {
     /*
     ** service does not exist; create it
     */
     theService = CreateService ( theSCM, theServiceName, theServiceName,
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START,
SERVICE_ERROR_IGNORE, args[ 0 ], null, null, null, null, null );

     if ( cast ( SC_HANDLE ) 0 == theService )
     {
      OutputDebugString ( "! CreateService" );
     }
     else
     {
      OutputDebugString ( ". CreateService" );

      CloseServiceHandle ( theService );
     }
    }
   }

   CloseServiceHandle ( theSCM );

  }

 }
 else
 {
  /*
  ** the service has finished running
  */
  OutputDebugString ( ". StartServiceCtrlDispatcher" );
 }

 return 0;

} // main ()


/*
** the name of this function is arbitrary
*/
void ServiceMain ( uint dwArgc, char * * lpszArgv )
{
 void * theEvent;
 SERVICE_STATUS theServiceStatus;
 SERVICE_STATUS_HANDLE theServiceStatusHandle;

 theServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
 theServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP |
SERVICE_ACCEPT_PAUSE_CONTINUE | SERVICE_ACCEPT_PARAMCHANGE;
 theServiceStatus.dwWin32ExitCode = 0;
 theServiceStatus.dwServiceSpecificExitCode = 0;
 theServiceStatus.dwCheckPoint = 0;
 theServiceStatus.dwWaitHint = 0;

 theServiceStatusHandle = RegisterServiceCtrlHandler ( theServiceName, & (
ServiceCtrlHandler ) );

 if ( cast ( SERVICE_STATUS_HANDLE ) 0 == theServiceStatusHandle )
 {
  OutputDebugString ( "! RegisterServiceCtrlHandlerEx" );
 }
 else
 {
  OutputDebugString ( ". RegisterServiceCtrlHandlerEx" );
 }

 theServiceStatus.dwCurrentState = SERVICE_START_PENDING;

 if ( ! SetServiceStatus ( theServiceStatusHandle, &theServiceStatus))
 {
  OutputDebugString ( "! SERVICE_START_PENDING" );
 }
 else
 {
  OutputDebugString ( ". SERVICE_START_PENDING" );
 }


 /*
 ** create a synchronization object so the control handler can notify when
to stop
 */
 theEvent = CreateEvent ( null, true, false, theServiceName );

 if ( null == theEvent )
 {
  theServiceStatus.dwCurrentState = SERVICE_STOPPED;

  if ( ! SetServiceStatus ( theServiceStatusHandle, & (
theServiceStatus ) ) )
  {
   OutputDebugString ( "! SERVICE_STOPPED" );
  }
  else
  {
   OutputDebugString ( ". SERVICE_STOPPED" );
  }

  return;
 }

 theServiceStatus.dwCurrentState = SERVICE_RUNNING;

 if ( ! SetServiceStatus ( theServiceStatusHandle, & (
theServiceStatus ) ) )
 {
  OutputDebugString ( "! SERVICE_RUNNING" );
 }
 else
 {
  OutputDebugString ( ". SERVICE_RUNNING" );
 }


 /*
 ** wait for notification to stop from the control handler
 */
 WaitForSingleObject ( theEvent, INFINITE );

 theServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;

 if ( ! SetServiceStatus ( theServiceStatusHandle, & (
theServiceStatus ) ) )
 {
  OutputDebugString ( "! SERVICE_STOP_PENDING" );
 }
 else
 {
  OutputDebugString ( ". SERVICE_STOP_PENDING" );
 }


 /*
 ** deref the synchronization object
 */
 CloseHandle ( theEvent );


 theServiceStatus.dwCurrentState = SERVICE_STOPPED;

 if ( ! SetServiceStatus ( theServiceStatusHandle, & (
theServiceStatus ) ) )
 {
  OutputDebugString ( "! SERVICE_STOPPED" );
 }
 else
 {
  OutputDebugString ( ". SERVICE_STOPPED" );
 }

 return;

} // ServiceMain ()


/*
** the name of this function is arbitrary
*/
void ServiceCtrlHandler ( uint dwControl )
{
 void * theEvent;

 switch ( dwControl )
 {
  case SERVICE_CONTROL_STOP:
   OutputDebugString ( ". SERVICE_CONTROL_STOP" );

   theEvent = OpenEvent ( EVENT_MODIFY_STATE, false, theServiceName );
   SetEvent ( theEvent );
   CloseHandle ( theEvent );

   break;

  case SERVICE_CONTROL_PAUSE:
   OutputDebugString ( ". SERVICE_CONTROL_PAUSE" );
   break;

  case SERVICE_CONTROL_CONTINUE:
   OutputDebugString ( ". SERVICE_CONTROL_CONTINUE" );
   break;

  case SERVICE_CONTROL_PARAMCHANGE:
   OutputDebugString ( ". SERVICE_CONTROL_PARAMCHANGE" );
   break;

  case SERVICE_CONTROL_INTERROGATE:
   OutputDebugString ( ". SERVICE_CONTROL_INTERROGATE" );
   break;

  case SERVICE_CONTROL_SHUTDOWN:
   OutputDebugString ( ". SERVICE_CONTROL_SHUTDOWN" );
   break;

  default:
   OutputDebugString ( ". ServiceCtrlHandler" );
   break;
 }

 return;

} // ServiceCtrlHandler ()

} // extern ( Windows )


begin 666 winsvc.d
M;6]D=6QE('=I;G-V8SL-" T*+RH-"BHJ(&QI;FL =VET:"!A9'9A<&DS,BYL
M:6(-"BHO#0H-"F5X<&]R="!E>'1E<FX *"!7:6YD;W=S("D-"GL-" T*8V]N
M<W0 8VAA<EM=(%-%4E9)0T537T%#5$E615]$051!0D%312 ](")397)V:6-E
M<T%C=&EV92([#0IC;VYS="!C:&%R6UT 4T525DE#15-?1D%)3$5$7T1!5$%"
M05-%(#T (E-E<G9I8V5S1F%I;&5D(CL-"F-O;G-T(&-H87( 4T-?1U)/55!?
M241%3E1)1DE%4B ]("<K)SL-" T*8V]N<W0 =6EN="!315)624-%7TY/7T-(
M04Y'12 ](#!X9F9F9F9F9F8[#0H-"F5N=6T .B!U:6YT#0I[#0H)4T525DE#
M15]!0U1)5D4 /2 P># P,# P,# Q+ T*"5-%4E9)0T5?24Y!0U1)5D4 /2 P
M># P,# P,# R+ T*"5-%4E9)0T5?4U1!5$5?04Q,(#T ,' P,# P,# P,PT*
M?0T*#0IE;G5M(#H =6EN= T*>PT*"5-%4E9)0T5?0T].5%)/3%]35$]0(#T 
M,' P,# P,# P,2P-" E315)624-%7T-/3E123TQ?4$%54T4 /2 P># P,# P
M,# R+ T*"5-%4E9)0T5?0T].5%)/3%]#3TY424Y512 ](#!X,# P,# P,#,L
M#0H)4T525DE#15]#3TY44D],7TE.5$524D]'051%(#T ,' P,# P,# P-"P-
M" E315)624-%7T-/3E123TQ?4TA55$1/5TX /2 P># P,# P,# U+ T*"5-%
M4E9)0T5?0T].5%)/3%]005)!34-(04Y'12 ](#!X,# P,# P,#8L#0H)4T52
M5DE#15]#3TY44D],7TY%5$))3D1!1$0 /2 P># P,# P,# W+ T*"5-%4E9)
M0T5?0T].5%)/3%].151"24Y$4D5-3U9%(#T ,' P,# P,# P."P-" E315)6
M24-%7T-/3E123TQ?3D540DE.1$5.04),12 ](#!X,# P,# P,#DL#0H)4T52
M5DE#15]#3TY44D],7TY%5$))3D1$25-!0DQ%(#T ,' P,# P,# P02P-" E3
M15)624-%7T-/3E123TQ?1$5624-%159%3E0 /2 P># P,# P,#!"+ T*"5-%
M4E9)0T5?0T].5%)/3%](05)$5T%215!23T9)3$5#2$%.1T4 /2 P># P,# P
M,#!#+ T*"5-%4E9)0T5?0T].5%)/3%]03U=%4D5614Y4(#T ,' P,# P,# P
M1"P-" E315)624-%7T-/3E123TQ?4T534TE/3D-(04Y'12 ](#!X,# P,# P
M,$4-"GT-" T*#0IE;G5M(#H =6EN= T*>PT*"5-%4E9)0T5?4U1/4%!%1" ]
M(#!X,# P,# P,#$L#0H)4T525DE#15]35$%25%]014Y$24Y'(#T ,' P,# P
M,# P,BP-" E315)624-%7U-43U!?4$5.1$E.1R ](#!X,# P,# P,#,L#0H)
M4T525DE#15]254Y.24Y'(#T ,' P,# P,# P-"P-" E315)624-%7T-/3E1)
M3E5%7U!%3D1)3D< /2 P># P,# P,# U+ T*"5-%4E9)0T5?4$%54T5?4$5.
M1$E.1R ](#!X,# P,# P,#8L#0H)4T525DE#15]00553140 /2 P># P,# P
M,# W#0I]#0H-"F5N=6T .B!U:6YT#0I[#0H)4T525DE#15]!0T-%4%1?4U1/
M4" ](#!X,# P,# P,#$L#0H)4T525DE#15]!0T-%4%1?4$%54T5?0T].5$E.
M544 /2 P># P,# P,# R+ T*"5-%4E9)0T5?04-#15!47U-(551$3U=.(#T 
M,' P,# P,# P-"P-" E315)624-%7T%#0T505%]005)!34-(04Y'12 ](#!X
M,# P,# P,# L#0H)4T525DE#15]!0T-%4%1?3D540DE.1$-(04Y'12 ](#!X
M,# P,# P,3 L#0H)4T525DE#15]!0T-%4%1?2$%21%=!4D504D]&24Q%0TA!
M3D=%(#T ,' P,# P,# R,"P-" E315)624-%7T%#0T505%]03U=%4D5614Y4
M(#T ,' P,# P,# T,"P-" E315)624-%7T%#0T505%]315-324].0TA!3D=%
M(#T ,' P,# P,# X, T*?0T*#0IE;G5M(#H =6EN= T*>PT*"5-#7TU!3D%'
M15)?0T].3D5#5" ](#!X,# P,2P-" E30U]-04Y!1T527T-214%415]315)6
M24-%(#T ,' P,# R+ T*"5-#7TU!3D%'15)?14Y53452051%7U-%4E9)0T4 
M/2 P># P,#0L#0H)4T-?34%.04=%4E],3T-+(#T ,' P,# X+ T*"5-#7TU!
M3D%'15)?455%4EE?3$]#2U]35$%455, /2 P># P,3 L#0H)4T-?34%.04=%
M4E]-3T1)1EE?0D]/5%]#3TY&24< /2 P># P,C L#0H)4T-?34%.04=%4E]!
M3$Q?04-#15-3(#T ,' P,#!&,# S9 T*?0T*#0H-"F5N=6T .B!U:6YT#0I[
M#0H)4T525DE#15]1545265]#3TY&24< /2 P># P,#$L#0H)4T525DE#15]#
M2$%.1T5?0T].1DE'(#T ,' P,# R+ T*"5-%4E9)0T5?455%4EE?4U1!5%53
M(#T ,' P,# T+ T*"5-%4E9)0T5?14Y53452051%7T1%4$5.1$5.5%, /2 P
M># P,# L#0H)4T525DE#15]35$%25" ](#!X,# Q,"P-" E315)624-%7U-4
M3U  /2 P># P,C L#0H)4T525DE#15]0055315]#3TY424Y512 ](#!X,# T
M,"P-" E315)624-%7TE.5$524D]'051%(#T ,' P,# P+ T*"5-%4E9)0T5?
M55-%4E]$149)3D5$7T-/3E123TP /2 P># Q,# L#0H)4T525DE#15]!3$Q?
M04-#15-3(#T ,' P,#!&,#%F9 T*?0T*#0IC;VYS="!U:6YT(%-%4E9)0T5?
M4E5.4U])3E]365-414U?4%)/0T534R ](#!X,# P,# P,#$[#0H-"F5N=6T-
M"GL-" E315)624-%7T-/3D9)1U]$15-#4DE05$E/3B ](#$L#0H)4T525DE#
M15]#3TY&24=?1D%)3%5215]!0U1)3TY3(#T , T*?0T*#0IS=')U8W0 4T52
M5DE#15]$15-#4DE05$E/3 T*>PT*"6-H87( *B!L<$1E<V-R:7!T:6]N.PT*
M?0T*86QI87, 4T525DE#15]$15-#4DE05$E/3B J($Q04T525DE#15]$15-#
M4DE05$E/3CL-" T*96YU;2!30U]!0U1)3TY?5%E010T*>PT*"5-#7T%#5$E/
M3E].3TY%(#T ,"P-" E30U]!0U1)3TY?4D535$%25" ](#$L#0H)4T-?04-4
M24].7U)%0D]/5" ](#(L#0H)4T-?04-424].7U)53E]#3TU-04Y$(#T ,PT*
M?0T*#0IS=')U8W0 4T-?04-424].#0I[#0H)4T-?04-424].7U194$4 5'EP
M93L-" EU:6YT($1E;&%Y.PT*?0T*86QI87, 4T-?04-424].("H 3%!30U]!
M0U1)3TX[#0H-"G-T<G5C="!315)624-%7T9!24Q54D5?04-424].4PT*>PT*
M"75I;G0 9'=297-E=%!E<FEO9#L-" EC:&%R("H ;'!296)O;W1-<V<[#0H)
M8VAA<B J(&QP0V]M;6%N9#L-" EU:6YT(&-!8W1I;VYS.PT*"5-#7T%#5$E/
M3B J(&QP<V%!8W1I;VYS.PT*?0T*86QI87, 4T525DE#15]&04E,55)%7T%#
M5$E/3E, *B!,4%-%4E9)0T5?1D%)3%5215]!0U1)3TY3.PT*#0IA;&EA<R!V
M;VED("H 4T-?2$%.1$Q%.PT*86QI87, 4T-?2$%.1$Q%("H 3%!30U](04Y$
M3$4[#0H-"F%L:6%S('9O:60 *B!315)624-%7U-405154U](04Y$3$4[#0H-
M"F5N=6T 4T-?4U1!5%537U194$4-"GL-" E30U]35$%455-?4%)/0T534U])
M3D9/(#T , T*?0T*#0IE;G5M(%-#7T5.54U?5%E010T*>PT*"5-#7T5.54U?
M4%)/0T534U])3D9/(#T , T*?0T*#0IS=')U8W0 4T525DE#15]35$%455,-
M"GL-" EU:6YT(&1W4V5R=FEC951Y<&4[#0H)=6EN="!D=T-U<G)E;G13=&%T
M93L-" EU:6YT(&1W0V]N=')O;'-!8V-E<'1E9#L-" EU:6YT(&1W5VEN,S)%
M>&ET0V]D93L-" EU:6YT(&1W4V5R=FEC95-P96-I9FEC17AI=$-O9&4[#0H)
M=6EN="!D=T-H96-K4&]I;G0[#0H)=6EN="!D=U=A:71(:6YT.PT*?0T*86QI
M87, 4T525DE#15]35$%455, *B!,4%-%4E9)0T5?4U1!5%53.PT*#0IS=')U
M8W0 4T525DE#15]35$%455-?4%)/0T534PT*>PT*"75I;G0 9'=397)V:6-E
M5'EP93L-" EU:6YT(&1W0W5R<F5N=%-T871E.PT*"75I;G0 9'=#;VYT<F]L
M<T%C8V5P=&5D.PT*"75I;G0 9'=7:6XS,D5X:71#;V1E.PT*"75I;G0 9'=3
M97)V:6-E4W!E8VEF:6-%>&ET0V]D93L-" EU:6YT(&1W0VAE8VM0;VEN=#L-
M" EU:6YT(&1W5V%I=$AI;G0[#0H)=6EN="!D=U!R;V-E<W-)9#L-" EU:6YT
M(&1W4V5R=FEC949L86=S.PT*?0T*86QI87, 4T525DE#15]35$%455-?4%)/
M0T534R J($Q04T525DE#15]35$%455-?4%)/0T534SL-" T*#0IS=')U8W0 
M14Y535]315)624-%7U-405154PT*>PT*"6-H87( *B!L<%-E<G9I8V5.86UE
M.PT*"6-H87( *B!L<$1I<W!L87E.86UE.PT*"5-%4E9)0T5?4U1!5%53(%-E
M<G9I8V53=&%T=7,[#0I]#0IA;&EA<R!%3E5-7U-%4E9)0T5?4U1!5%53("H 
M3%!%3E5-7U-%4E9)0T5?4U1!5%53.PT*#0H-"G-T<G5C="!%3E5-7U-%4E9)
M0T5?4U1!5%537U!23T-%4U,-"GL-" EC:&%R("H ;'!397)V:6-E3F%M93L-
M" EC:&%R("H ;'!$:7-P;&%Y3F%M93L-" E315)624-%7U-405154U]04D]#
M15-3(%-E<G9I8V53=&%T=7-0<F]C97-S.PT*?0T*86QI87, 14Y535]315)6
M24-%7U-405154U]04D]#15-3("H 3%!%3E5-7U-%4E9)0T5?4U1!5%537U!2
M3T-%4U,[#0H-"F%L:6%S('9O:60 *B!30U],3T-+.PT*#0IS=')U8W0 455%
M4EE?4T525DE#15],3T-+7U-405154PT*>PT*"75I;G0 9DES3&]C:V5D.PT*
M"6-H87( *B!L<$QO8VM/=VYE<CL-" EU:6YT(&1W3&]C:T1U<F%T:6]N.PT*
M?0T*86QI87, 455%4EE?4T525DE#15],3T-+7U-405154R J($Q0455%4EE?
M4T525DE#15],3T-+7U-405154SL-" T*<W1R=6-T(%%515)97U-%4E9)0T5?
M0T].1DE'#0I[#0H)=6EN="!D=U-E<G9I8V54>7!E.PT*"75I;G0 9'=3=&%R
M=%1Y<&4[#0H)=6EN="!D=T5R<F]R0V]N=')O;#L-" EC:&%R("H ;'!":6YA
M<GE0871H3F%M93L-" EC:&%R("H ;'!,;V%D3W)D97)'<F]U<#L-" EU:6YT
M(&1W5&%G260[#0H)8VAA<B J(&QP1&5P96YD96YC:65S.PT*"6-H87( *B!L
M<%-E<G9I8V53=&%R=$YA;64[#0H)8VAA<B J(&QP1&ES<&QA>4YA;64[#0I]
M#0IA;&EA<R!1545265]315)624-%7T-/3D9)1R J($Q0455%4EE?4T525DE#
M15]#3TY&24<[#0H-" T*86QI87, =F]I9" H*B!,4%-%4E9)0T5?34%)3E]&
M54Y#5$E/3BD-"B -" EU:6YT(&1W3G5M4V5R=FEC97-!<F=S+ T*"6-H87( 
M*B J(&QP4V5R=FEC94%R9U9E8W1O<G,-"BD[#0H-"G-T<G5C="!315)624-%
M7U1!0DQ%7T5.5%)9#0I[#0H)8VAA<B J(&QP4V5R=FEC94YA;64[#0H)3%!3
M15)624-%7TU!24Y?1E5.0U1)3TX ;'!397)V:6-E4')O8SL-"GT-" T*86QI
M87, 4T525DE#15]404),15]%3E1262 J($Q04T525DE#15]404),15]%3E12
M63L-" T*#0IA;&EA<R!V;VED(" J($Q02$%.1$Q%4E]&54Y#5$E/3BD-"B -
M" EU:6YT(&1W0V]N=')O; T**3L-" T*#0IA;&EA<R!V;VED(" J($Q02$%.
M1$Q%4E]&54Y#5$E/3E]%6"D-"B -" EU:6YT(&1W0V]N=')O;"P-" EU:6YT
M(&1W179E;G14>7!E+ T*"79O:60 *B!L<$5V96YT1&%T82P-" EV;VED("H 
M;'!#;VYT97AT#0HI.PT*#0H-"FEN= T*0VAA;F=E4V5R=FEC94-O;F9I9T$-
M"B -" E30U](04Y$3$4 :%-E<G9I8V4L#0H)=6EN="!D=U-E<G9I8V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=6EN="!D=T1E<VER
M961!8V-E<W,L#0H)=6EN="!D=U-E<G9I8V54>7!E+ T*"75I;G0 9'=3=&%R
M=%1Y<&4L#0H)=6EN="!D=T5R<F]R0V]N=')O;"P-" EC:&%R("H ;'!":6YA
M<GE0871H3F%M92P-" EC:&%R("H ;'!,;V%D3W)D97)'<F]U<"P-" EU:6YT
M("H ;'!D=U1A9TED+ T*"6-H87( *B!L<$1E<&5N9&5N8VEE<RP-" EC:&%R
M("H ;'!397)V:6-E4W1A<G1.86UE+ T*"6-H87( *B!L<%!A<W-W;W)D#0HI
M.PT*#0IV97)S:6]N("  54Y)0T]$12 I#0I[#0H)86QI87, 0W)E871E4V5R
M=FEC95< 0W)E871E4V5R=FEC93L-"GT-"F5L<V4-"GL-" EA;&EA<R!#<F5A
M=&5397)V:6-E02!#<F5A=&5397)V:6-E.PT*?0T*#0H-"FEN= T*1&5L971E
M4V5R=FEC90T** T*"5-#7TA!3D1,12!H4V5R=FEC90T**3L-" T*#0II;G0-
M"D5N=6U$97!E;F1E;G1397)V:6-E<T$-"B -" E30U](04Y$3$4 :%-E<G9I
M8V4L#0H)=6EN="!D=U-E<G9I8V53=&%T92P-" E,4$5.54U?4T525DE#15]3
M5$%455, ;'!397)V:6-E<RP-" EU:6YT(&-B0G5F4VEZ92P-" EU:6YT("H 
M<&-B0GET97-.965D960L#0H)=6EN=" J(&QP4V5R=FEC97-2971U<FYE9 T*
M*3L-" T*:6YT#0I%;G5M1&5P96YD96YT4V5R=FEC97-7#0HH#0H)4T-?2$%.
M1$Q%(&A397)V:6-E+ T*"75I;G0 9'=397)V:6-E4W1A=&4L#0H)3%!%3E5-
M7U-%4E9)0T5?4U1!5%53(&QP4V5R=FEC97,L#0H)=6EN="!C8D)U9E-I>F4L
M#0H)=6EN=" J('!C8D)Y=&5S3F5E9&5D+ T*"75I;G0 *B!L<%-E<G9I8V5S
M4F5T=7)N960-"BD[#0H-"G9E<G-I;VX *"!53DE#3T1%("D-"GL-" EA;&EA
M<R!%;G5M1&5P96YD96YT4V5R=FEC97-7($5N=6U$97!E;F1E;G1397)V:6-E
M<SL-"GT-"F5L<V4-"GL-" EA;&EA<R!%;G5M1&5P96YD96YT4V5R=FEC97-!
M($5N=6U$97!E;F1E;G1397)V:6-E<SL-"GT-" T*#0II;G0-"D5N=6U397)V
M:6-E<U-T871U<T$-"B -" E30U](04Y$3$4 :%-#36%N86=E<BP-" EU:6YT
M(&1W4V5R=FEC951Y<&4L#0H)=6EN="!D=U-E<G9I8V53=&%T92P-" E,4$5.
M54U?4T525DE#15]35$%455, ;'!397)V:6-E<RP-" EU:6YT(&-B0G5F4VEZ
M92P-" EU:6YT("H <&-B0GET97-.965D960L#0H)=6EN=" J(&QP4V5R=FEC
M97-2971U<FYE9"P-" EU:6YT("H ;'!297-U;65(86YD;&4-"BD[#0H-"FEN
M= T*16YU;5-E<G9I8V5S4W1A='5S5PT** T*"5-#7TA!3D1,12!H4T--86YA
M9V5R+ T*"75I;G0 9'=397)V:6-E5'EP92P-" EU:6YT(&1W4V5R=FEC95-T
M871E+ T*"4Q014Y535]315)624-%7U-405154R!L<%-E<G9I8V5S+ T*"75I
M;G0 8V)"=693:7IE+ T*"75I;G0 *B!P8V)">71E<TYE961E9"P-" EU:6YT
M("H ;'!397)V:6-E<U)E='5R;F5D+ T*"75I;G0 *B!L<%)E<W5M94AA;F1L
M90T**3L-" T*=F5R<VEO;B H(%5.24-/1$4 *0T*>PT*"6%L:6%S($5N=6U3
M97)V:6-E<U-T871U<U< 16YU;5-E<G9I8V5S4W1A='5S.PT*?0T*96QS90T*
M>PT*"6%L:6%S($5N=6U397)V:6-E<U-T871U<T$ 16YU;5-E<G9I8V5S4W1A
M='5S.PT*?0T*#0H-"FEN= T*16YU;5-E<G9I8V5S4W1A='5S17A!#0HH#0H)
M4T-?2$%.1$Q%(&A30TUA;F%G97(L#0H)4T-?14Y535]465!%($EN9F],979E
M;"P-" EU:6YT(&1W4V5R=FEC951Y<&4L#0H)=6EN="!D=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T*"75I;G0 *B!L<&-C
M:$)U9F9E< T**3L-" T*=F5R<VEO;B H(%5.24-/1$4 *0T*>PT*"6%L:6%S
M($=E=%-E<G9I8V5+97E.86UE5R!'971397)V:6-E2V5Y3F%M93L-"GT-"F5L
M<V4-"GL-" EA;&EA<R!'971397)V:6-E2V5Y3F%M94$ 1V5T4V5R=FEC94ME
M>4YA;64[#0I]#0H-" T*:6YT#0I'971397)V:6-E1&ES<&QA>4YA;65!#0HH
M#0H)4T-?2$%.1$Q%(&A30TUA;F%G97(L#0H)8VAA<B J(&QP4V5R=FEC94YA
M;64L#0H)8VAA<B J(&QP1&ES<&QA>4YA;64L#0H)=6EN=" J(&QP8V-H0G5F
M9F5R#0HI.PT*#0II;G0-"D=E=%-E<G9I8V5$:7-P;&%Y3F%M95<-"B -" E3
M0U](04Y$3$4 :%-#36%N86=E<BP-" EC:&%R("H ;'!397)V:6-E3F%M92P-
M" EC:&%R("H ;'!$:7-P;&%Y3F%M92P-" EU:6YT("H ;'!C8VA"=69F97(-
M"BD[#0H-"G9E<G-I;VX *"!53DE#3T1%("D-"GL-" EA;&EA<R!'971397)V
M:6-E1&ES<&QA>4YA;657($=E=%-E<G9I8V5$:7-P;&%Y3F%M93L-"GT-"F5L
M<V4-"GL-" EA;&EA<R!'971397)V:6-E1&ES<&QA>4YA;65!($=E=%-E<G9I
M8V5$:7-P;&%Y3F%M93L-"GT-" T*4T-?3$]#2PT*3&]C:U-E<G9I8V5$871A
M8F%S90T** T*"5-#7TA!3D1,12!H4T--86YA9V5R#0HI.PT*#0H-"FEN= T*
M3F]T:69Y0F]O=$-O;F9I9U-T871U<PT** T*"6EN="!";V]T06-C97!T86)L
M90T**3L-" T*#0I30U](04Y$3$4-"D]P96Y30TUA;F%G97)!#0HH#0H)8VAA
M<B J(&QP36%C:&EN94YA;64L#0H)8VAA<B J(&QP1&%T86)A<V5.86UE+ T*
M"75I;G0 9'=$97-I<F5D06-C97-S#0HI.PT*#0I30U](04Y$3$4-"D]P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U-T871U
M<RP-" EU:6YT(&-B0G5F4VEZ92P-" EU:6YT("H <&-B0GET97-.965D960-
M"BD[#0H-"G9E<G-I;VX *"!53DE#3T1%("D-"GL-" EA;&EA<R!1=65R>5-E
M<G9I8V5,;V-K4W1A='5S5R!1=65R>5-E<G9I8V5,;V-K4W1A='5S.PT*?0T*
M96QS90T*>PT*"6%L:6%S(%%U97)Y4V5R=FEC94QO8VM3=&%T=7-!(%%U97)Y
M4V5R=FEC94QO8VM3=&%T=7,[#0I]#0H-" T*86QI87, =F]I9" J(%!314-5
M4DE465]$15-#4DE05$]2.PT*86QI87, =6EN="!314-54DE465])3D9/4DU!
M5$E/3CL-" T*#0II;G0-"E%U97)Y4V5R=FEC94]B:F5C=%-E8W5R:71Y#0HH
M#0H)4T-?2$%.1$Q%(&A397)V:6-E+ T*"5-%0U5225197TE.1D]234%424].
M(&1W4V5C=7)I='E);F9O<FUA=&EO;BP-" E04T5#55))5%E?1$530U))4%1/
M4B!L<%-E8W5R:71Y1&5S8W)I<'1O<BP-" EU:6YT(&-B0G5F4VEZ92P-" EU
M:6YT("H <&-B0GET97-.965D960-"BD[#0H-"FEN= T*475E<GE397)V:6-E
M4W1A='5S#0HH#0H)4T-?2$%.1$Q%(&A397)V:6-E+ T*"4Q04T525DE#15]3
M5$%455, ;'!397)V:6-E4W1A='5S#0HI.PT*#0H-"FEN= T*475E<GE397)V
M:6-E4W1A='5S17 -"B -" E30U](04Y$3$4 :%-E<G9I8V4L#0H)4T-?4U1!
M5%537U194$4 26YF;TQE=F5L+ T*"75B>71E("H ;'!"=69F97(L#0H)=6EN
M="!C8D)U9E-I>F4L#0H)=6EN=" J('!C8D)Y=&5S3F5E9&5D#0HI.PT*#0H-
M"E-%4E9)0T5?4U1!5%537TA!3D1,10T*4F5G:7-T97)397)V:6-E0W1R;$AA
M;F1L97)!#0HH#0H)8VAA<B J(&QP4V5R=FEC94YA;64L#0H)3%!(04Y$3$52
M7T953D-424].(&QP2&%N9&QE<E!R;V,-"BD[#0H-"E-%4E9)0T5?4U1!5%53
M7TA!3D1,10T*4F5G:7-T97)397)V:6-E0W1R;$AA;F1L97)7#0HH#0H)8VAA
M<B J(&QP4V5R=FEC94YA;64L#0H)3%!(04Y$3$527T953D-424].(&QP2&%N
M9&QE<E!R;V,-"BD[#0H-"G9E<G-I;VX *"!53DE#3T1%("D-"GL-" EA;&EA
M<R!296=I<W1E<E-E<G9I8V5#=')L2&%N9&QE<E< 4F5G:7-T97)397)V:6-E
M0W1R;$AA;F1L97([#0I]#0IE;'-E#0I[#0H)86QI87, 4F5G:7-T97)397)V
M:6-E0W1R;$AA;F1L97)!(%)E9VES=&5R4V5R=FEC94-T<FQ(86YD;&5R.PT*
M?0T*#0H-"E-%4E9)0T5?4U1!5%537TA!3D1,10T*4F5G:7-T97)397)V:6-E
M0W1R;$AA;F1L97)%>$$-"B -" EC:&%R("H ;'!397)V:6-E3F%M92P-" E,
M4$A!3D1,15)?1E5.0U1)3TY?15  ;'!(86YD;&5R4')O8RP-" EV;VED("H 
M;'!#;VYT97AT#0HI.PT*#0I315)624-%7U-405154U](04Y$3$4-"E)E9VES
M=&5R4V5R=FEC94-T<FQ(86YD;&5R17A7#0HH#0H)8VAA<B J(&QP4V5R=FEC
M94YA;64L#0H)3%!(04Y$3$527T953D-424].7T58(&QP2&%N9&QE<E!R;V,L
M#0H)=F]I9" J(&QP0V]N=&5X= T**3L-" T*=F5R<VEO;B H(%5.24-/1$4 
M*0T*>PT*"6%L:6%S(%)E9VES=&5R4V5R=FEC94-T<FQ(86YD;&5R17A7(%)E
M9VES=&5R4V5R=FEC94-T<FQ(86YD;&5R17 [#0I]#0IE;'-E#0I[#0H)86QI
M87, 4F5G:7-T97)397)V:6-E0W1R;$AA;F1L97)%>$$ 4F5G:7-T97)397)V
M:6-E0W1R;$AA;F1L97)%>#L-"GT-" T*#0II;G0-"E-E=%-E<G9I8V5/8FIE
M8W1396-U<FET>0T** T*"5-#7TA!3D1,12!H4V5R=FEC92P-" E314-54DE4
M65])3D9/4DU!5$E/3B!D=U-E8W5R:71Y26YF;W)M871I;VXL#0H)4%-%0U52
M25197T1%4T-225!43U( ;'!396-U<FET>41E<V-R:7!T;W(-"BD[#0H-"FEN
M= T*4V5T4V5R=FEC95-T871U<PT** T*"5-%4E9)0T5?4U1!5%537TA!3D1,
M12!H4V5R=FEC95-T871U<RP-" E,4%-%4E9)0T5?4U1!5%53(&QP4V5R=FEC
M95-T871U<PT**3L-" T*#0II;G0-"E-T87)T4V5R=FEC94-T<FQ$:7-P871C
M:&5R00T** T*"5-%4E9)0T5?5$%"3$5?14Y44ED *B!L<%-E<G9I8V53=&%R
M=%1A8FQE#0HI.PT*#0II;G0-"E-T87)T4V5R=FEC94-T<FQ$:7-P871C:&5R
M5PT** T*"5-%4E9)0T5?5$%"3$5?14Y44ED *B!L<%-E<G9I8V53=&%R=%1A
M8FQE#0HI.PT*#0IV97)S:6]N("  54Y)0T]$12 I#0I[#0H)86QI87, 4W1A
M<G1397)V:6-E0W1R;$1I<W!A=&-H97)7(%-T87)T4V5R=FEC94-T<FQ$:7-P
M871C:&5R.PT*?0T*96QS90T*>PT*"6%L:6%S(%-T87)T4V5R=FEC94-T<FQ$
M:7-P871C:&5R02!3=&%R=%-E<G9I8V5#=')L1&ES<&%T8VAE<CL-"GT-" T*
M#0II;G0-"E-T87)T4V5R=FEC94$-"B -" E30U](04Y$3$4 :%-E<G9I8V4L
M#0H)=6EN="!D=TYU;5-E<G9I8V5!<F=S+ T*"6-H87( *B J(&QP4V5R=FEC
M94%R9U9E8W1O<G,-"BD[#0H-"FEN= T*4W1A<G1397)V:6-E5PT** T*"5-#
M7TA!3D1,12!H4V5R=FEC92P-" EU:6YT(&1W3G5M4V5R=FEC94%R9W,L#0H)
M8VAA<B J("H ;'!397)V:6-E07)G5F5C=&]R<PT**3L-" T*=F5R<VEO;B H
M(%5.24-/1$4 *0T*>PT*"6%L:6%S(%-T87)T4V5R=FEC95< 4W1A<G1397)V
M:6-E.PT*?0T*96QS90T*>PT*"6%L:6%S(%-T87)T4V5R=FEC94$ 4W1A<G13
M97)V:6-E.PT*?0T*#0H-"FEN= T*56YL;V-K4V5R=FEC941A=&%B87-E#0HH
M#0H)4T-?3$]#2R!38TQO8VL-"BD[#0H-"GT +R\ 97AT97)N("  5VEN9&]W
#<R I
`
end

begin 666 winbase.d
M;6]D=6QE('=I;F)A<V4[#0H-"F5X<&]R="!E>'1E<FX *"!7:6YD;W=S("D-
M"GL-" T*8V]N<W0 =6EN="!)3D9)3DE412 ](#!X9F9F9F9F9F8[#0IC;VYS
M="!U:6YT(%-404Y$05)$7U))1TA44U]215%525)%1" ](#!X,# P1C P,# [
M#0IC;VYS="!U:6YT(%-93D-(4D].25I%(#T ,' P,#$P,# P,$P[#0H-"F-O
M;G-T('5I;G0 159%3E1?34]$24997U-4051%(#T ,' P,# R.PT*8V]N<W0 
M=6EN="!%5D5.5%]!3$Q?04-#15-3(#T 4U1!3D1!4D1?4DE'2%137U)%455)
M4D5$('P 4UE.0TA23TY)6D4 ?" P>#,[#0H-"G-T<G5C="!314-54DE465]!
M5%1224)55$53#0I[#0H)=6EN="!N3&5N9W1H.PT*"79O:60 *B!L<%-E8W5R
M:71Y1&5S8W)I<'1O<CL-" EI;G0 8DEN:&5R:71(86YD;&4[#0I]#0H-"F%L
M:6%S(%-%0U5225197T%45%))0E5415, *B!04T5#55))5%E?05144DE"551%
M4SL-"F%L:6%S(%-%0U5225197T%45%))0E5415, *B!,4%-%0U5225197T%4
M5%))0E5415,[#0H-"G5I;G0-"D=E=$QA<W1%<G)O<B H*3L-" T*#0IV;VED
M("H-"D-R96%T945V96YT00T** T*"4Q04T5#55))5%E?05144DE"551%4R!L
M<$5V96YT071T<FEB=71E<RP-" EI;G0 8DUA;G5A;%)E<V5T+ T*"6EN="!B
M26YI=&EA;%-T871E+ T*"6-H87( *B!L<$YA;64-"BD[#0H-"G9O:60 * T*
M0W)E871E179E;G17#0HH#0H)3%!314-54DE465]!5%1224)55$53(&QP179E
M;G1!='1R:6)U=&5S+ T*"6EN="!B36%N=6%L4F5S970L#0H):6YT(&));FET
M:6%L4W1A=&4L#0H)8VAA<B J(&QP3F%M90T**3L-" T*=F5R<VEO;B H(%5.
M24-/1$4 *0T*>PT*"6%L:6%S($-R96%T945V96YT5R!#<F5A=&5%=F5N=#L-
M"GT-"F5L<V4-"GL-" EA;&EA<R!#<F5A=&5%=F5N=$$ 0W)E871E179E;G0[
M#0I]#0H-" T*=F]I9" J#0I/<&5N179E;G1!#0HH#0H)=6EN="!D=T1E<VER
M961!8V-E<W,L#0H):6YT(&));FAE<FET2&%N9&QE+ T*"6-H87( *B!L<$YA
M;64-"BD[#0H-"G9O:60 * T*3W!E;D5V96YT5PT** T*"75I;G0 9'=$97-I
M<F5D06-C97-S+ T*"6EN="!B26YH97)I=$AA;F1L92P-" EC:&%R("H ;'!.
M86UE#0HI.PT*#0IV97)S:6]N("  54Y)0T]$12 I#0I[#0H)86QI87, 3W!E
M;D5V96YT5R!/<&5N179E;G0[#0I]#0IE;'-E#0I[#0H)86QI87, 3W!E;D5V
M96YT02!/<&5N179E;G0[#0I]#0H-"FEN= T*4V5T179E;G0-"B -" EV;VED
M("H :$5V96YT#0HI.PT*#0II;G0-"E)E<V5T179E;G0-"B -" EV;VED("H 
M:$5V96YT#0HI.PT*#0II;G0-"E!U;'-E179E;G0-"B -" EV;VED("H :$5V
M96YT#0HI.PT*#0IU:6YT#0I786ET1F]R4VEN9VQE3V)J96-T#0HH#0H)=F]I
M9" J(&A(86YD;&4L#0H)=6EN="!D=TUI;&QI<V5C;VYD<PT**3L-" T*=6EN
M= T*5V%I=$9O<DUU;'1I<&QE3V)J96-T<PT** T*"75I;G0 ;D-O=6YT+ T*
M"79O:60 *B J(&QP2&%N9&QE<RP-" EI;G0 8E=A:71!;&PL#0H)=6EN="!D
M=TUI;&QI<V5C;VYD<PT**3L-" T*:6YT#0I#;&]S94AA;F1L90T** T*"79O
M:60 *B!H3V)J96-T#0HI.PT*#0H-"G9O:60-"D]U='!U=$1E8G5G4W1R:6YG
M00T** T*"6-H87( *B!L<$]U='!U=%-T<FEN9PT**3L-" T*=F]I9 T*3W5T
M<'5T1&5B=6=3=')I;F=7#0HH#0H)8VAA<B J(&QP3W5T<'5T4W1R:6YG#0HI
M.PT*#0IV97)S:6]N("  54Y)0T]$12 I#0I[#0H)86QI87, 3W5T<'5T1&5B
M=6=3=')I;F=7($]U='!U=$1E8G5G4W1R:6YG.PT*?0T*96QS90T*>PT*"6%L
M:6%S($]U='!U=$1E8G5G4W1R:6YG02!/=71P=71$96)U9U-T<FEN9SL-"GT-
M" T*#0IV;VED("H-"D=E=$-U<G)E;G10<F]C97-S(" I.PT*#0IU:6YT#0I'
M971#=7)R96YT4')O8V5S<TED(" I.PT*#0H-"G5I;G0-"D=E=$UO9'5L949I
M;&5.86UE00T** T*"79O:60 *B!H36]D=6QE+ T*"6]U="!C:&%R("H ;'!&
M:6QE;F%M92P-" EU:6YT(&Y3:7IE#0HI.PT*#0IU:6YT#0I'971-;V1U;&5&
M:6QE3F%M95<-"B -" EV;VED("H :$UO9'5L92P-" EO=70 8VAA<B J(&QP
M1FEL96YA;64L#0H)=6EN="!N4VEZ90T**3L-" T*=F5R<VEO;B H(%5.24-/
M1$4 *0T*>PT*"6%L:6%S($=E=$UO9'5L949I;&5.86UE5R!'971-;V1U;&5&
M:6QE3F%M93L-"GT-"F5L<V4-"GL-" EA;&EA<R!'971-;V1U;&5&:6QE3F%M
M94$ 1V5T36]D=6QE1FEL94YA;64[#0I]#0H-"GT +R\ 97AP;W)T(&5X=&5R
/;B H(%=I;F1O=W, *0T*
`
end

begin 666 winerror.d
M;6]D=6QE('=I;F5R<F]R.PT*#0IE>'!O<G0 97AT97)N("  5VEN9&]W<R I
M#0I[#0H-"F-O;G-T('5I;G0 15)23U)?4T525DE#15]$3T537TY/5%]%6$E3
K5" ](#$P-C [#0H-"GT +R\ 97AP;W)T(&5X=&5R;B H(%=I;F1O=W, *0``
`
end

begin 666 winnt.d
M;6]D=6QE('=I;FYT.PT*#0IE>'!O<G0 97AT97)N("  5VEN9&]W<R I#0I[
M#0H-"F-O;G-T('5I;G0 1$5,151%(#T ,' P,# Q,# P,#L-"F-O;G-T('5I
M;G0 4D5!1%]#3TY44D],(#T ,' P,# R,# P,#L-"F-O;G-T('5I;G0 5U))
M5$5?1$%#(#T ,' P,# T,# P,#L-"F-O;G-T('5I;G0 5U))5$5?3U=.15( 
M/2 P># P,# P,# P.PT*8V]N<W0 =6EN="!364Y#2%)/3DE:12 ](#!X,# Q
M,# P,# [#0IC;VYS="!U:6YT(%-404Y$05)$7U))1TA44U]215%525)%1" ]
M(#!X,# P1C P,# [#0IC;VYS="!U:6YT(%-404Y$05)$7U))1TA44U]214%$
M(#T 4D5!1%]#3TY44D],.PT*8V]N<W0 =6EN="!35$%.1$%21%]224=(5%-?
M5U))5$4 /2!214%$7T-/3E123TP[#0IC;VYS="!U:6YT(%-404Y$05)$7U))
M1TA44U]%6$5#551%(#T 4D5!1%]#3TY44D],.PT*8V]N<W0 =6EN="!35$%.
M1$%21%]224=(5%-?04Q,(#T ,' P,#%&,# P,#L-"F-O;G-T('5I;G0 4U!%
M0TE&24-?4DE'2%137T%,3" ](#!X,# P,$9&1D8[#0IC;VYS="!U:6YT($%#
M0T534U]365-414U?4T5#55))5%D /2 P># Q,# P,# P.PT*8V]N<W0 =6EN
M="!-05A)355-7T%,3$]7140 /2 P># R,# P,# P.PT*8V]N<W0 =6EN="!'
M14Y%4DE#7U)%040 /2 P># P,# P,# P.PT*8V]N<W0 =6EN="!'14Y%4DE#
M7U=2251%(#T ,' T,# P,# P,#L-"F-O;G-T('5I;G0 1T5.15))0U]%6$5#
M551%(#T ,' R,# P,# P,#L-"F-O;G-T('5I;G0 1T5.15))0U]!3$P /2 P
M>#$P,# P,# P.PT*#0H-"F-O;G-T('5I;G0 4T525DE#15]+15).14Q?1%))
M5D52(#T ,' P,# P,# P,3L-"F-O;G-T('5I;G0 4T525DE#15]&24Q%7U-9
M4U1%35]$4DE615( /2 P># P,# P,# R.PT*8V]N<W0 =6EN="!315)624-%
M7T%$05!415( /2 P># P,# P,# T.PT*8V]N<W0 =6EN="!315)624-%7U)%
M0T]'3DE:15)?1%))5D52(#T ,' P,# P,# P.#L-"F-O;G-T('5I;G0 4T52
M5DE#15]$4DE615( /2!315)624-%7TM%4DY%3%]$4DE615( ?"!315)624-%
M7T9)3$5?4UE35$5-7T12259%4B!\(%-%4E9)0T5?4D5#3T=.25I%4E]$4DE6
M15([#0IC;VYS="!U:6YT(%-%4E9)0T5?5TE.,S)?3U=.7U!23T-%4U, /2 P
M># P,# P,#$P.PT*8V]N<W0 =6EN="!315)624-%7U=)3C,R7U-(05)%7U!2
M3T-%4U, /2 P># P,# P,#(P.PT*8V]N<W0 =6EN="!315)624-%7U=)3C,R
M(#T 4T525DE#15]724XS,E]/5TY?4%)/0T534R!\(%-%4E9)0T5?5TE.,S)?
M4TA!4D5?4%)/0T534SL-"F-O;G-T('5I;G0 4T525DE#15])3E1%4D%#5$E6
M15]04D]#15-3(#T ,' P,# P,#$P,#L-"F-O;G-T('5I;G0 4T525DE#15]4
M65!%7T%,3" ](%-%4E9)0T5?5TE.,S( ?"!315)624-%7T%$05!415( ?"!3
M15)624-%7T12259%4B!\(%-%4E9)0T5?24Y415)!0U1)5D5?4%)/0T534SL-
M" T*96YU;2 Z('5I;G0-"GL-" E315)624-%7T)/3U1?4U1!4E0 /2 P># P
M,# P,# P+ T*"5-%4E9)0T5?4UE35$5-7U-405)4(#T ,' P,# P,# P,2P-
M" E315)624-%7T%55$]?4U1!4E0 /2 P># P,# P,# R+ T*"5-%4E9)0T5?
M1$5-04Y$7U-405)4(#T ,' P,# P,# P,RP-" E315)624-%7T1)4T%"3$5$
M(#T ,' P,# P,# P- T*?0T*#0IE;G5M(#H =6EN= T*>PT*"5-%4E9)0T5?
M15)23U)?24=.3U)%(#T ,' P,# P,# P,"P-" E315)624-%7T524D]27TY/
M4DU!3" ](#!X,# P,# P,#$L#0H)4T525DE#15]%4E)/4E]3159%4D4 /2 P
M># P,# P,# R+ T*"5-%4E9)0T5?15)23U)?0U))5$E#04P /2 P># P,# P
M,# S#0I]#0H-"F%L:6%S('9O:60 *B!04T5#55))5%E?1$530U))4%1/4CL-
M"F%L:6%S('5I;G0 4T5#55))5%E?24Y&3U)-051)3TX[#0H-"GT +R\ 97AP
6;W)T(&5X=&5R;B H(%=I;F1O=W, *0``
`
end
May 27 2004
parent reply David L. Davis <David_member pathlink.com> writes:
Gifford: I really would like to take a good look at your work and download all
the .d files, but I'm not sure how grab the encrypted ones. I thought by setting
up my Outlook 2003 for this news group that it would help me over viewing this
site in IE 6, but they look exactly the same. (Go Figure!) 

Anyway, I have a strong interest in making a windows service, I want to rewrite
an old "C" audit program I wrote years ago that tracked program usage by user
and such. And since I'm really enjoying "D's" great support for strings...I'd
love to use D to recreate it with. Man, I've forgotten how many times I've had
to type in lines and lines of malloc()s, strcpy()s, strcat()s and such, just to
do the most simplest of string work. But with "D," no more of that sort of
thing!!! 

Also, if you have a web site with these files in a .zip, or .rar, or even a html
web page to copy & paste from, please point me to them!

Thanks in Advance. :)
May 27 2004
next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
David L. Davis wrote:
 Gifford: I really would like to take a good look at your work and download all
 the .d files, but I'm not sure how grab the encrypted ones. I thought by
setting
 up my Outlook 2003 for this news group that it would help me over viewing this
 site in IE 6, but they look exactly the same. (Go Figure!) 
That's odd. I had no problem accessing these files in Mozilla Thunderbird. (I don't know why Outlook wouldn't be able to handle them.) I posted a .zip of the files at my website: http://jcc_7.tripod.com/d/win_service/index.html
 
 Anyway, I have a strong interest in making a windows service, I want to rewrite
 an old "C" audit program I wrote years ago that tracked program usage by user
 and such. And since I'm really enjoying "D's" great support for strings...I'd
 love to use D to recreate it with. Man, I've forgotten how many times I've had
 to type in lines and lines of malloc()s, strcpy()s, strcat()s and such, just to
 do the most simplest of string work. But with "D," no more of that sort of
 thing!!! 
 
 Also, if you have a web site with these files in a .zip, or .rar, or even a
html
 web page to copy & paste from, please point me to them!
 
 Thanks in Advance. :) 
-- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
May 27 2004
parent David L. Davis <David_member pathlink.com> writes:
J C Calvarese: Thanks, I've downloaded the D source code for a "Windows Service"
zip from your web site. 

I'm going to go back recheck my setup in Outlook, I must have done (or undone)
something. But "the Outlook help, isn't very helpful"...and this is the first
time I tried to set it up for a news group. Back to the drawing board. :)

Thxs Again!

P.S. And Gifford Hesketh, thanks for putting this code together to work with D!

In article <c968m1$2lf1$1 digitaldaemon.com>, J C Calvarese says...
That's odd. I had no problem accessing these files in Mozilla 
Thunderbird. (I don't know why Outlook wouldn't be able to handle them.) 
I posted a .zip of the files at my website: 
http://jcc_7.tripod.com/d/win_service/index.html
May 28 2004
prev sibling parent reply "Gifford Hesketh" <gifford.hesketh savvis.net> writes:
I have put the code up for browsing here:
    http://users.adelphia.net/~4187/gifford/src/d/service/

FWIW, the last issue I pinned down was how to make code using
"theServiceTable" compile and work.  When I first made this in in January or
Febrary, I had the variable declared as SERVICE_TABLE_ENTRY[2] -- and that
worked.  I have since updated to D 0.90, which would not succeed compiling
the same code (it was actually linking that failed).  I tried changing it to
SERVICE_TABLE_ENTRY *, but I could not figure out how to get malloc() to
happen.  The D code that worked
	SERVICE_TABLE_ENTRY[] theServiceTable;
	theServiceTable.length = 2;is functionally very much like the same code I
wrote in C:

    SERVICE_TABLE_ENTRY * pServiceTable;
    pServiceTable = ( SERVICE_TABLE_ENTRY * ) malloc ( 2 * sizeof (
SERVICE_TABLE_ENTRY ) );


"David L. Davis" <David_member pathlink.com> wrote in message
news:c95svk$258v$1 digitaldaemon.com...
 Gifford: I really would like to take a good look at your work and download
all
 the .d files, but I'm not sure how grab the encrypted ones. I thought by
setting
 up my Outlook 2003 for this news group that it would help me over viewing
this
 site in IE 6, but they look exactly the same. (Go Figure!)

 Anyway, I have a strong interest in making a windows service, I want to
rewrite
 an old "C" audit program I wrote years ago that tracked program usage by
user
 and such. And since I'm really enjoying "D's" great support for
strings...I'd
 love to use D to recreate it with. Man, I've forgotten how many times I've
had
 to type in lines and lines of malloc()s, strcpy()s, strcat()s and such,
just to
 do the most simplest of string work. But with "D," no more of that sort of
 thing!!!

 Also, if you have a web site with these files in a .zip, or .rar, or even
a html
 web page to copy & paste from, please point me to them!

 Thanks in Advance. :)
May 28 2004
parent David L. Davis <SpottedTiger yahoo.com> writes:
Gifford: Thanks for putting the code up on to a web page, by the way, if I
create anything somewhat useful I'll share it with you, and anyone else who'll
find a use for it. I'm thinking of digging up that old "C" audit (program
usage/amount of time running/by user) code I was talking about before, if
nothing else it might ->service<- (:P) as some example code. If I recall
correctly, it was a simple but useful little app that ran in the background
creating text usage log file. We'll see. :))

Thxs Again! 

In article <c981h4$29aj$1 digitaldaemon.com>, Gifford Hesketh says...
I have put the code up for browsing here:
    http://users.adelphia.net/~4187/gifford/src/d/service/

FWIW, the last issue I pinned down was how to make code using
"theServiceTable" compile and work.  When I first made this in in January or
Febrary, I had the variable declared as SERVICE_TABLE_ENTRY[2] -- and that
worked.  I have since updated to D 0.90, which would not succeed compiling
the same code (it was actually linking that failed).  I tried changing it to
SERVICE_TABLE_ENTRY *, but I could not figure out how to get malloc() to
happen.  The D code that worked
	SERVICE_TABLE_ENTRY[] theServiceTable;
	theServiceTable.length = 2;is functionally very much like the same code I
wrote in C:

    SERVICE_TABLE_ENTRY * pServiceTable;
    pServiceTable = ( SERVICE_TABLE_ENTRY * ) malloc ( 2 * sizeof (
SERVICE_TABLE_ENTRY ) );
May 28 2004