~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to packages/extra/winunits/jwalmsvc.pas

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{******************************************************************************}
2
 
{                                                                              }
3
 
{ Lan Manager Service API interface Unit for Object Pascal                     }
4
 
{                                                                              }
5
 
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
6
 
{ Corporation. All Rights Reserved.                                            }
7
 
{                                                                              }
8
 
{ The original file is: lmsvc.h, released November 2001. The original Pascal   }
9
 
{ code is: LmSvc.pas, released Februari 2002. The initial developer of the     }
10
 
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl).               }
11
 
{                                                                              }
12
 
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
13
 
{ Marcel van Brakel. All Rights Reserved.                                      }
14
 
{                                                                              }
15
 
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
16
 
{                                                                              }
17
 
{ You may retrieve the latest version of this file at the Project JEDI         }
18
 
{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
19
 
{                                                                              }
20
 
{ The contents of this file are used with permission, subject to the Mozilla   }
21
 
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
 
{ in compliance with the License. You may obtain a copy of the License at      }
23
 
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
24
 
{                                                                              }
25
 
{ Software distributed under the License is distributed on an "AS IS" basis,   }
26
 
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
 
{ the specific language governing rights and limitations under the License.    }
28
 
{                                                                              }
29
 
{ Alternatively, the contents of this file may be used under the terms of the  }
30
 
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
31
 
{ provisions of the LGPL License are applicable instead of those above.        }
32
 
{ If you wish to allow use of your version of this file only under the terms   }
33
 
{ of the LGPL License and not to allow others to use your version of this file }
34
 
{ under the MPL, indicate your decision by deleting  the provisions above and  }
35
 
{ replace  them with the notice and other provisions required by the LGPL      }
36
 
{ License.  If you do not delete the provisions above, a recipient may use     }
37
 
{ your version of this file under either the MPL or the LGPL License.          }
38
 
{                                                                              }
39
 
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
40
 
{                                                                              }
41
 
{******************************************************************************}
42
 
 
43
 
// $Id: jwalmsvc.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
44
 
 
45
 
unit JwaLmSvc;
46
 
 
47
 
{$WEAKPACKAGEUNIT}
48
 
 
49
 
{$HPPEMIT ''}
50
 
{$HPPEMIT '#include "lmsvc.h"'}
51
 
{$HPPEMIT ''}
52
 
 
53
 
{$I jediapilib.inc}
54
 
 
55
 
interface
56
 
 
57
 
uses
58
 
  JwaLmCons, JwaWinType;
59
 
 
60
 
//
61
 
//  Data Structures
62
 
//
63
 
 
64
 
type
65
 
  LPSERVICE_INFO_0 = ^SERVICE_INFO_0;
66
 
  {$EXTERNALSYM LPSERVICE_INFO_0}
67
 
  PSERVICE_INFO_0 = ^SERVICE_INFO_0;
68
 
  {$EXTERNALSYM PSERVICE_INFO_0}
69
 
  _SERVICE_INFO_0 = record
70
 
    svci0_name: LPWSTR;
71
 
  end;
72
 
  {$EXTERNALSYM _SERVICE_INFO_0}
73
 
  SERVICE_INFO_0 = _SERVICE_INFO_0;
74
 
  {$EXTERNALSYM SERVICE_INFO_0}
75
 
  TServiceInfo0 = SERVICE_INFO_0;
76
 
  PServiceInfo0 = PSERVICE_INFO_0;
77
 
 
78
 
  LPSERVICE_INFO_1 = ^SERVICE_INFO_1;
79
 
  {$EXTERNALSYM LPSERVICE_INFO_1}
80
 
  PSERVICE_INFO_1 = ^SERVICE_INFO_1;
81
 
  {$EXTERNALSYM PSERVICE_INFO_1}
82
 
  _SERVICE_INFO_1 = record
83
 
    svci1_name: LPWSTR;
84
 
    svci1_status: DWORD;
85
 
    svci1_code: DWORD;
86
 
    svci1_pid: DWORD;
87
 
  end;
88
 
  {$EXTERNALSYM _SERVICE_INFO_1}
89
 
  SERVICE_INFO_1 = _SERVICE_INFO_1;
90
 
  {$EXTERNALSYM SERVICE_INFO_1}
91
 
  TServiceInfo1 = SERVICE_INFO_1;
92
 
  PServiceInfo1 = PSERVICE_INFO_1;
93
 
 
94
 
  LPSERVICE_INFO_2 = ^SERVICE_INFO_2;
95
 
  {$EXTERNALSYM LPSERVICE_INFO_2}
96
 
  PSERVICE_INFO_2 = ^SERVICE_INFO_2;
97
 
  {$EXTERNALSYM PSERVICE_INFO_2}
98
 
  _SERVICE_INFO_2 = record
99
 
    svci2_name: LPWSTR;
100
 
    svci2_status: DWORD;
101
 
    svci2_code: DWORD;
102
 
    svci2_pid: DWORD;
103
 
    svci2_text: LPWSTR;
104
 
    svci2_specific_error: DWORD;
105
 
    svci2_display_name: LPWSTR;
106
 
  end;
107
 
  {$EXTERNALSYM _SERVICE_INFO_2}
108
 
  SERVICE_INFO_2 = _SERVICE_INFO_2;
109
 
  {$EXTERNALSYM SERVICE_INFO_2}
110
 
  TServiceInfo2 = SERVICE_INFO_2;
111
 
  PServiceInfo2 = PSERVICE_INFO_2;
112
 
 
113
 
//
114
 
// Function Prototypes
115
 
//
116
 
 
117
 
function NetServiceControl(servername, service: LPCWSTR; opcode: DWORD; arg: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
118
 
{$EXTERNALSYM NetServiceControl}
119
 
 
120
 
function NetServiceEnum(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries, resume_handle: LPDWORD): NET_API_STATUS; stdcall;
121
 
{$EXTERNALSYM NetServiceEnum}
122
 
 
123
 
function NetServiceGetInfo(servername, service: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
124
 
{$EXTERNALSYM NetServiceGetInfo}
125
 
 
126
 
function NetServiceInstall(servername, service: LPCWSTR; argc: DWORD; argv: LPCWSTR; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
127
 
{$EXTERNALSYM NetServiceInstall}
128
 
 
129
 
//
130
 
// Special Values and Constants
131
 
//
132
 
 
133
 
//
134
 
//  Bitmask and bit values for svci1_status, and svci2_status
135
 
//  fields.  For each "subfield", there is a mask defined,
136
 
//  and a number of constants representing the value
137
 
//  obtained by doing (status & mask).
138
 
//
139
 
 
140
 
// Bits 0,1 -- general status
141
 
 
142
 
const
143
 
  SERVICE_INSTALL_STATE     = $03;
144
 
  {$EXTERNALSYM SERVICE_INSTALL_STATE}
145
 
  SERVICE_UNINSTALLED       = $00;
146
 
  {$EXTERNALSYM SERVICE_UNINSTALLED}
147
 
  SERVICE_INSTALL_PENDING   = $01;
148
 
  {$EXTERNALSYM SERVICE_INSTALL_PENDING}
149
 
  SERVICE_UNINSTALL_PENDING = $02;
150
 
  {$EXTERNALSYM SERVICE_UNINSTALL_PENDING}
151
 
  SERVICE_INSTALLED         = $03;
152
 
  {$EXTERNALSYM SERVICE_INSTALLED}
153
 
 
154
 
// Bits 2,3 -- paused/active status
155
 
 
156
 
  SERVICE_PAUSE_STATE           = $0C;
157
 
  {$EXTERNALSYM SERVICE_PAUSE_STATE}
158
 
  LM20_SERVICE_ACTIVE           = $00;
159
 
  {$EXTERNALSYM LM20_SERVICE_ACTIVE}
160
 
  LM20_SERVICE_CONTINUE_PENDING = $04;
161
 
  {$EXTERNALSYM LM20_SERVICE_CONTINUE_PENDING}
162
 
  LM20_SERVICE_PAUSE_PENDING    = $08;
163
 
  {$EXTERNALSYM LM20_SERVICE_PAUSE_PENDING}
164
 
  LM20_SERVICE_PAUSED           = $0C;
165
 
  {$EXTERNALSYM LM20_SERVICE_PAUSED}
166
 
 
167
 
// Bit 4 -- uninstallable indication
168
 
 
169
 
  SERVICE_NOT_UNINSTALLABLE = $00;
170
 
  {$EXTERNALSYM SERVICE_NOT_UNINSTALLABLE}
171
 
  SERVICE_UNINSTALLABLE     = $10;
172
 
  {$EXTERNALSYM SERVICE_UNINSTALLABLE}
173
 
 
174
 
// Bit 5 -- pausable indication
175
 
 
176
 
  SERVICE_NOT_PAUSABLE = $00;
177
 
  {$EXTERNALSYM SERVICE_NOT_PAUSABLE}
178
 
  SERVICE_PAUSABLE     = $20;
179
 
  {$EXTERNALSYM SERVICE_PAUSABLE}
180
 
 
181
 
// Workstation service only:
182
 
// Bits 8,9,10 -- redirection paused/active
183
 
 
184
 
  SERVICE_REDIR_PAUSED       = $700;
185
 
  {$EXTERNALSYM SERVICE_REDIR_PAUSED}
186
 
  SERVICE_REDIR_DISK_PAUSED  = $100;
187
 
  {$EXTERNALSYM SERVICE_REDIR_DISK_PAUSED}
188
 
  SERVICE_REDIR_PRINT_PAUSED = $200;
189
 
  {$EXTERNALSYM SERVICE_REDIR_PRINT_PAUSED}
190
 
  SERVICE_REDIR_COMM_PAUSED  = $400;
191
 
  {$EXTERNALSYM SERVICE_REDIR_COMM_PAUSED}
192
 
 
193
 
//
194
 
//  Additional standard LAN Manager for MS-DOS services
195
 
//
196
 
 
197
 
  SERVICE_DOS_ENCRYPTION = WideString('ENCRYPT');
198
 
  {$EXTERNALSYM SERVICE_DOS_ENCRYPTION}
199
 
 
200
 
//
201
 
//  NetServiceControl opcodes.
202
 
//
203
 
 
204
 
  SERVICE_CTRL_INTERROGATE = 0;
205
 
  {$EXTERNALSYM SERVICE_CTRL_INTERROGATE}
206
 
  SERVICE_CTRL_PAUSE       = 1;
207
 
  {$EXTERNALSYM SERVICE_CTRL_PAUSE}
208
 
  SERVICE_CTRL_CONTINUE    = 2;
209
 
  {$EXTERNALSYM SERVICE_CTRL_CONTINUE}
210
 
  SERVICE_CTRL_UNINSTALL   = 3;
211
 
  {$EXTERNALSYM SERVICE_CTRL_UNINSTALL}
212
 
 
213
 
//
214
 
//  Workstation service only:  Bits used in the "arg" parameter
215
 
//  to NetServiceControl in conjunction with the opcode
216
 
//  SERVICE_CTRL_PAUSE or SERVICE_CTRL_CONTINUE, to pause or
217
 
//  continue redirection.
218
 
//
219
 
 
220
 
  SERVICE_CTRL_REDIR_DISK  = $1;
221
 
  {$EXTERNALSYM SERVICE_CTRL_REDIR_DISK}
222
 
  SERVICE_CTRL_REDIR_PRINT = $2;
223
 
  {$EXTERNALSYM SERVICE_CTRL_REDIR_PRINT}
224
 
  SERVICE_CTRL_REDIR_COMM  = $4;
225
 
  {$EXTERNALSYM SERVICE_CTRL_REDIR_COMM}
226
 
 
227
 
//
228
 
//  Values for svci1_code, and svci2_code when status
229
 
//  of the service is SERVICE_INSTALL_PENDING or
230
 
//  SERVICE_UNINSTALL_PENDING.
231
 
//  A service can optionally provide a hint to the installer
232
 
//  that the install is proceeding and how long to wait
233
 
//  (in 0.1 second increments) before querying status again.
234
 
//
235
 
 
236
 
  SERVICE_IP_NO_HINT  = $0;
237
 
  {$EXTERNALSYM SERVICE_IP_NO_HINT}
238
 
  SERVICE_CCP_NO_HINT = $0;
239
 
  {$EXTERNALSYM SERVICE_CCP_NO_HINT}
240
 
 
241
 
  SERVICE_IP_QUERY_HINT  = $10000;
242
 
  {$EXTERNALSYM SERVICE_IP_QUERY_HINT}
243
 
  SERVICE_CCP_QUERY_HINT = $10000;
244
 
  {$EXTERNALSYM SERVICE_CCP_QUERY_HINT}
245
 
 
246
 
//
247
 
// Mask for install proceeding checkpoint number
248
 
//
249
 
 
250
 
  SERVICE_IP_CHKPT_NUM  = $0FF;
251
 
  {$EXTERNALSYM SERVICE_IP_CHKPT_NUM}
252
 
  SERVICE_CCP_CHKPT_NUM = $0FF;
253
 
  {$EXTERNALSYM SERVICE_CCP_CHKPT_NUM}
254
 
 
255
 
//
256
 
// Mask for wait time hint before querying again
257
 
//
258
 
 
259
 
  SERVICE_IP_WAIT_TIME  = $0FF00;
260
 
  {$EXTERNALSYM SERVICE_IP_WAIT_TIME}
261
 
  SERVICE_CCP_WAIT_TIME = $0FF00;
262
 
  {$EXTERNALSYM SERVICE_CCP_WAIT_TIME}
263
 
 
264
 
//
265
 
// Shift count for building wait time _code values
266
 
//
267
 
 
268
 
  SERVICE_IP_WAITTIME_SHIFT   = 8;
269
 
  {$EXTERNALSYM SERVICE_IP_WAITTIME_SHIFT}
270
 
  SERVICE_NTIP_WAITTIME_SHIFT = 12;
271
 
  {$EXTERNALSYM SERVICE_NTIP_WAITTIME_SHIFT}
272
 
 
273
 
//
274
 
// Mask used for upper and lower portions of wait hint time.
275
 
//
276
 
 
277
 
  UPPER_HINT_MASK     = $0000FF00;
278
 
  {$EXTERNALSYM UPPER_HINT_MASK}
279
 
  LOWER_HINT_MASK     = $000000FF;
280
 
  {$EXTERNALSYM LOWER_HINT_MASK}
281
 
  UPPER_GET_HINT_MASK = $0FF00000;
282
 
  {$EXTERNALSYM UPPER_GET_HINT_MASK}
283
 
  LOWER_GET_HINT_MASK = $0000FF00;
284
 
  {$EXTERNALSYM LOWER_GET_HINT_MASK}
285
 
  SERVICE_NT_MAXTIME  = $0000FFFF;
286
 
  {$EXTERNALSYM SERVICE_NT_MAXTIME}
287
 
  SERVICE_RESRV_MASK  = $0001FFFF;
288
 
  {$EXTERNALSYM SERVICE_RESRV_MASK}
289
 
  SERVICE_MAXTIME     = $000000FF;
290
 
  {$EXTERNALSYM SERVICE_MAXTIME}
291
 
 
292
 
//
293
 
//  SERVICE_BASE is the base of service error codes,
294
 
//  chosen to avoid conflict with OS, redirector,
295
 
//  netapi, and errlog codes.
296
 
//
297
 
// Don't change the comments following the manifest constants without
298
 
// understanding how mapmsg works.
299
 
//
300
 
 
301
 
  SERVICE_BASE       = 3050;
302
 
  {$EXTERNALSYM SERVICE_BASE}
303
 
  SERVICE_UIC_NORMAL = 0;
304
 
  {$EXTERNALSYM SERVICE_UIC_NORMAL}
305
 
 
306
 
{*
307
 
 *  Uninstall codes, to be used in high byte of 'code' on final NetStatus,
308
 
 *  which sets the status to UNINSTALLED.
309
 
 *}
310
 
 
311
 
  SERVICE_UIC_BADPARMVAL = SERVICE_BASE + 1;
312
 
  {$EXTERNALSYM SERVICE_UIC_BADPARMVAL}
313
 
 
314
 
{*
315
 
 * The Registry or the information you just typed includes an illegal
316
 
 * value for "%1".
317
 
 *}
318
 
 
319
 
  SERVICE_UIC_MISSPARM = SERVICE_BASE + 2;
320
 
  {$EXTERNALSYM SERVICE_UIC_MISSPARM}
321
 
 
322
 
{*
323
 
 * The required parameter was not provided on the command
324
 
 * line or in the configuration file.
325
 
 *}
326
 
 
327
 
  SERVICE_UIC_UNKPARM = SERVICE_BASE + 3;
328
 
  {$EXTERNALSYM SERVICE_UIC_UNKPARM}
329
 
 
330
 
{*
331
 
 * LAN Manager does not recognize "%1" as a valid option.
332
 
 *}
333
 
 
334
 
  SERVICE_UIC_RESOURCE = SERVICE_BASE + 4;
335
 
  {$EXTERNALSYM SERVICE_UIC_RESOURCE}
336
 
 
337
 
{*
338
 
 * A request for resource could not be satisfied.
339
 
 *}
340
 
 
341
 
  SERVICE_UIC_CONFIG = SERVICE_BASE + 5;
342
 
  {$EXTERNALSYM SERVICE_UIC_CONFIG}
343
 
 
344
 
{*
345
 
 * A problem exists with the system configuration.
346
 
 *}
347
 
 
348
 
  SERVICE_UIC_SYSTEM = SERVICE_BASE + 6;
349
 
  {$EXTERNALSYM SERVICE_UIC_SYSTEM}
350
 
 
351
 
{*
352
 
 * A system error has occurred.
353
 
 *}
354
 
 
355
 
  SERVICE_UIC_INTERNAL = SERVICE_BASE + 7;
356
 
  {$EXTERNALSYM SERVICE_UIC_INTERNAL}
357
 
 
358
 
{*
359
 
 * An internal consistency error has occurred.
360
 
 *}
361
 
 
362
 
  SERVICE_UIC_AMBIGPARM = SERVICE_BASE + 8;
363
 
  {$EXTERNALSYM SERVICE_UIC_AMBIGPARM}
364
 
 
365
 
{*
366
 
 * The configuration file or the command line has an ambiguous option.
367
 
 *}
368
 
 
369
 
  SERVICE_UIC_DUPPARM = SERVICE_BASE + 9;
370
 
  {$EXTERNALSYM SERVICE_UIC_DUPPARM}
371
 
 
372
 
{*
373
 
 * The configuration file or the command line has a duplicate parameter.
374
 
 *}
375
 
 
376
 
  SERVICE_UIC_KILL = SERVICE_BASE + 10;
377
 
  {$EXTERNALSYM SERVICE_UIC_KILL}
378
 
 
379
 
{*
380
 
 * The service did not respond to control and was stopped with
381
 
 * the DosKillProc function.
382
 
 *}
383
 
 
384
 
  SERVICE_UIC_EXEC = SERVICE_BASE + 11;
385
 
  {$EXTERNALSYM SERVICE_UIC_EXEC}
386
 
 
387
 
{*
388
 
 * An error occurred when attempting to run the service program.
389
 
 *}
390
 
 
391
 
  SERVICE_UIC_SUBSERV = SERVICE_BASE + 12;
392
 
  {$EXTERNALSYM SERVICE_UIC_SUBSERV}
393
 
 
394
 
{*
395
 
 * The sub-service failed to start.
396
 
 *}
397
 
 
398
 
  SERVICE_UIC_CONFLPARM = SERVICE_BASE + 13;
399
 
  {$EXTERNALSYM SERVICE_UIC_CONFLPARM}
400
 
 
401
 
{*
402
 
 * There is a conflict in the value or use of these options: %1.
403
 
 *}
404
 
 
405
 
  SERVICE_UIC_FILE = SERVICE_BASE + 14;
406
 
  {$EXTERNALSYM SERVICE_UIC_FILE}
407
 
 
408
 
{*
409
 
 * There is a problem with the file.
410
 
 *}
411
 
 
412
 
//
413
 
//  The modifiers
414
 
//
415
 
 
416
 
//
417
 
// General:
418
 
//
419
 
 
420
 
  SERVICE_UIC_M_NULL = 0;
421
 
  {$EXTERNALSYM SERVICE_UIC_M_NULL}
422
 
 
423
 
//
424
 
//  RESOURCE:
425
 
//
426
 
 
427
 
  SERVICE_UIC_M_MEMORY    = SERVICE_BASE + 20; // memory
428
 
  {$EXTERNALSYM SERVICE_UIC_M_MEMORY}
429
 
  SERVICE_UIC_M_DISK      = SERVICE_BASE + 21; // disk space
430
 
  {$EXTERNALSYM SERVICE_UIC_M_DISK}
431
 
  SERVICE_UIC_M_THREADS   = SERVICE_BASE + 22; // thread
432
 
  {$EXTERNALSYM SERVICE_UIC_M_THREADS}
433
 
  SERVICE_UIC_M_PROCESSES = SERVICE_BASE + 23; // process
434
 
  {$EXTERNALSYM SERVICE_UIC_M_PROCESSES}
435
 
 
436
 
//
437
 
//  CONFIG:
438
 
//
439
 
 
440
 
//
441
 
// Security failure
442
 
//
443
 
 
444
 
  SERVICE_UIC_M_SECURITY = SERVICE_BASE + 24;
445
 
  {$EXTERNALSYM SERVICE_UIC_M_SECURITY}
446
 
 
447
 
{* Security Failure. %0 *}
448
 
 
449
 
  SERVICE_UIC_M_LANROOT = SERVICE_BASE + 25;
450
 
  {$EXTERNALSYM SERVICE_UIC_M_LANROOT}
451
 
 
452
 
{*
453
 
 * Bad or missing LAN Manager root directory.
454
 
 *}
455
 
 
456
 
  SERVICE_UIC_M_REDIR = SERVICE_BASE + 26;
457
 
  {$EXTERNALSYM SERVICE_UIC_M_REDIR}
458
 
 
459
 
{*
460
 
 * The network software is not installed.
461
 
 *}
462
 
 
463
 
  SERVICE_UIC_M_SERVER = SERVICE_BASE + 27;
464
 
  {$EXTERNALSYM SERVICE_UIC_M_SERVER}
465
 
 
466
 
{*
467
 
 * The server is not started.
468
 
 *}
469
 
 
470
 
  SERVICE_UIC_M_SEC_FILE_ERR = SERVICE_BASE + 28;
471
 
  {$EXTERNALSYM SERVICE_UIC_M_SEC_FILE_ERR}
472
 
 
473
 
{*
474
 
 * The server cannot access the user accounts database (NET.ACC).
475
 
 *}
476
 
 
477
 
  SERVICE_UIC_M_FILES = SERVICE_BASE + 29;
478
 
  {$EXTERNALSYM SERVICE_UIC_M_FILES}
479
 
 
480
 
{*
481
 
 * Incompatible files are installed in the LANMAN tree.
482
 
 *}
483
 
 
484
 
  SERVICE_UIC_M_LOGS = SERVICE_BASE + 30;
485
 
  {$EXTERNALSYM SERVICE_UIC_M_LOGS}
486
 
 
487
 
{*
488
 
 * The LANMAN\LOGS directory is invalid.
489
 
 *}
490
 
 
491
 
  SERVICE_UIC_M_LANGROUP = SERVICE_BASE + 31;
492
 
  {$EXTERNALSYM SERVICE_UIC_M_LANGROUP}
493
 
 
494
 
{*
495
 
 * The domain specified could not be used.
496
 
 *}
497
 
 
498
 
  SERVICE_UIC_M_MSGNAME = SERVICE_BASE + 32;
499
 
  {$EXTERNALSYM SERVICE_UIC_M_MSGNAME}
500
 
 
501
 
{*
502
 
 * The computer name is being used as a message alias on another computer.
503
 
 *}
504
 
 
505
 
  SERVICE_UIC_M_ANNOUNCE = SERVICE_BASE + 33;
506
 
  {$EXTERNALSYM SERVICE_UIC_M_ANNOUNCE}
507
 
 
508
 
{*
509
 
 * The announcement of the server name failed.
510
 
 *}
511
 
 
512
 
  SERVICE_UIC_M_UAS = SERVICE_BASE + 34;
513
 
  {$EXTERNALSYM SERVICE_UIC_M_UAS}
514
 
 
515
 
{*
516
 
 * The user accounts database is not configured correctly.
517
 
 *}
518
 
 
519
 
  SERVICE_UIC_M_SERVER_SEC_ERR = SERVICE_BASE + 35;
520
 
  {$EXTERNALSYM SERVICE_UIC_M_SERVER_SEC_ERR}
521
 
 
522
 
{*
523
 
 * The server is not running with user-level security.
524
 
 *}
525
 
 
526
 
  SERVICE_UIC_M_WKSTA = SERVICE_BASE + 37;
527
 
  {$EXTERNALSYM SERVICE_UIC_M_WKSTA}
528
 
 
529
 
{*
530
 
 * The workstation is not configured properly.
531
 
 *}
532
 
 
533
 
  SERVICE_UIC_M_ERRLOG = SERVICE_BASE + 38;
534
 
  {$EXTERNALSYM SERVICE_UIC_M_ERRLOG}
535
 
 
536
 
{*
537
 
 * View your error log for details.
538
 
 *}
539
 
 
540
 
  SERVICE_UIC_M_FILE_UW = SERVICE_BASE + 39;
541
 
  {$EXTERNALSYM SERVICE_UIC_M_FILE_UW}
542
 
 
543
 
{*
544
 
 * Unable to write to this file.
545
 
 *}
546
 
 
547
 
  SERVICE_UIC_M_ADDPAK = SERVICE_BASE + 40;
548
 
  {$EXTERNALSYM SERVICE_UIC_M_ADDPAK}
549
 
 
550
 
{*
551
 
 * ADDPAK file is corrupted.  Delete LANMAN\NETPROG\ADDPAK.SER
552
 
 * and reapply all ADDPAKs.
553
 
 *}
554
 
 
555
 
  SERVICE_UIC_M_LAZY = SERVICE_BASE + 41;
556
 
  {$EXTERNALSYM SERVICE_UIC_M_LAZY}
557
 
 
558
 
{*
559
 
 * The LM386 server cannot be started because CACHE.EXE is not running.
560
 
 *}
561
 
 
562
 
  SERVICE_UIC_M_UAS_MACHINE_ACCT = SERVICE_BASE + 42;
563
 
  {$EXTERNALSYM SERVICE_UIC_M_UAS_MACHINE_ACCT}
564
 
 
565
 
{*
566
 
 * There is no account for this computer in the security database.
567
 
 *}
568
 
 
569
 
  SERVICE_UIC_M_UAS_SERVERS_NMEMB = SERVICE_BASE + 43;
570
 
  {$EXTERNALSYM SERVICE_UIC_M_UAS_SERVERS_NMEMB}
571
 
 
572
 
{*
573
 
 * This computer is not a member of the group SERVERS.
574
 
 *}
575
 
 
576
 
  SERVICE_UIC_M_UAS_SERVERS_NOGRP = SERVICE_BASE + 44;
577
 
  {$EXTERNALSYM SERVICE_UIC_M_UAS_SERVERS_NOGRP}
578
 
 
579
 
{*
580
 
 * The group SERVERS is not present in the local security database.
581
 
 *}
582
 
 
583
 
  SERVICE_UIC_M_UAS_INVALID_ROLE = SERVICE_BASE + 45;
584
 
  {$EXTERNALSYM SERVICE_UIC_M_UAS_INVALID_ROLE}
585
 
 
586
 
{*
587
 
 * This computer is configured as a member of a workgroup, not as
588
 
 * a member of a domain. The Netlogon service does not need to run in this
589
 
 * configuration.
590
 
 *}
591
 
 
592
 
  SERVICE_UIC_M_NETLOGON_NO_DC = SERVICE_BASE + 46;
593
 
  {$EXTERNALSYM SERVICE_UIC_M_NETLOGON_NO_DC}
594
 
 
595
 
{*
596
 
 * The primary Domain Controller for this domain could not be located.
597
 
 *}
598
 
 
599
 
  SERVICE_UIC_M_NETLOGON_DC_CFLCT = SERVICE_BASE + 47;
600
 
  {$EXTERNALSYM SERVICE_UIC_M_NETLOGON_DC_CFLCT}
601
 
 
602
 
{*
603
 
 * This computer is configured to be the primary domain controller of its domain.
604
 
 * However, the computer %1 is currently claiming to be the primary domain controller
605
 
 * of the domain.
606
 
 *}
607
 
 
608
 
  SERVICE_UIC_M_NETLOGON_AUTH = SERVICE_BASE + 48;
609
 
  {$EXTERNALSYM SERVICE_UIC_M_NETLOGON_AUTH}
610
 
 
611
 
{*
612
 
 * The service failed to authenticate with the primary domain controller.
613
 
 *}
614
 
 
615
 
  SERVICE_UIC_M_UAS_PROLOG = SERVICE_BASE + 49;
616
 
  {$EXTERNALSYM SERVICE_UIC_M_UAS_PROLOG}
617
 
 
618
 
{*
619
 
 * There is a problem with the security database creation date or serial number.
620
 
 *}
621
 
 
622
 
  SERVICE2_BASE = 5600;
623
 
  {$EXTERNALSYM SERVICE2_BASE}
624
 
 
625
 
{* new SEVICE_UIC messages go here *}
626
 
 
627
 
  SERVICE_UIC_M_NETLOGON_MPATH = SERVICE2_BASE + 0;
628
 
  {$EXTERNALSYM SERVICE_UIC_M_NETLOGON_MPATH}
629
 
 
630
 
{*
631
 
 * Could not share the User or Script path.
632
 
 *}
633
 
 
634
 
  SERVICE_UIC_M_LSA_MACHINE_ACCT = SERVICE2_BASE + 1;
635
 
  {$EXTERNALSYM SERVICE_UIC_M_LSA_MACHINE_ACCT}
636
 
 
637
 
{*
638
 
 * The password for this computer is not found in the local security
639
 
 * database.
640
 
 *}
641
 
 
642
 
  SERVICE_UIC_M_DATABASE_ERROR = SERVICE2_BASE + 2;
643
 
  {$EXTERNALSYM SERVICE_UIC_M_DATABASE_ERROR}
644
 
 
645
 
{*
646
 
 * An internal error occurred while accessing the computer's
647
 
 * local or network security database.
648
 
 *}
649
 
 
650
 
//
651
 
//  End modifiers
652
 
//
653
 
 
654
 
//
655
 
// Commonly used Macros:
656
 
//
657
 
 
658
 
function SERVICE_IP_CODE(tt, nn: LONG): LONG;
659
 
{$EXTERNALSYM SERVICE_IP_CODE}
660
 
 
661
 
function SERVICE_CCP_CODE(tt, nn: LONG): LONG;
662
 
{$EXTERNALSYM SERVICE_CCP_CODE}
663
 
 
664
 
function SERVICE_UIC_CODE(cc, mm: LONG): LONG;
665
 
{$EXTERNALSYM SERVICE_UIC_CODE}
666
 
 
667
 
//
668
 
// This macro takes a wait hint (tt) which can have a maximum value of
669
 
// 0xFFFF and puts it into the service status code field.
670
 
// 0x0FF1FFnn  (where nn is the checkpoint information).
671
 
//
672
 
 
673
 
function SERVICE_NT_CCP_CODE(tt, nn: LONG): LONG;
674
 
{$EXTERNALSYM SERVICE_NT_CCP_CODE}
675
 
 
676
 
//
677
 
// This macro takes a status code field, and strips out the wait hint
678
 
// from the upper and lower sections.
679
 
// 0x0FF1FFnn results in 0x0000FFFF.
680
 
//
681
 
 
682
 
function SERVICE_NT_WAIT_GET(code: DWORD): DWORD;
683
 
{$EXTERNALSYM SERVICE_NT_WAIT_GET}
684
 
 
685
 
implementation
686
 
 
687
 
// #define SERVICE_IP_CODE(tt,nn) ((long)SERVICE_IP_QUERY_HINT|(long)(nn|(tt<<SERVICE_IP_WAITTIME_SHIFT)))
688
 
 
689
 
function SERVICE_IP_CODE(tt, nn: LONG): LONG;
690
 
begin
691
 
  Result := SERVICE_IP_QUERY_HINT or (nn or (tt shl SERVICE_IP_WAITTIME_SHIFT));
692
 
end;
693
 
 
694
 
// #define SERVICE_CCP_CODE(tt,nn) ((long)SERVICE_CCP_QUERY_HINT|(long)(nn|(tt<<SERVICE_IP_WAITTIME_SHIFT)))
695
 
 
696
 
function SERVICE_CCP_CODE(tt, nn: LONG): LONG;
697
 
begin
698
 
  Result := SERVICE_CCP_QUERY_HINT or (nn or (tt shl SERVICE_IP_WAITTIME_SHIFT));
699
 
end;
700
 
 
701
 
// #define SERVICE_UIC_CODE(cc,mm) ((long)(((long)cc<<16)|(long)(unsigned short)mm))
702
 
 
703
 
function SERVICE_UIC_CODE(cc, mm: LONG): LONG;
704
 
begin
705
 
  Result := (cc shl 16) or WORD(mm);
706
 
end;
707
 
 
708
 
// #define SERVICE_NT_CCP_CODE(tt,nn)  \
709
 
//   (  \
710
 
//     ((long)SERVICE_CCP_QUERY_HINT)   | \
711
 
//     ((long)(nn))   | \
712
 
//     (((tt)&LOWER_HINT_MASK) << SERVICE_IP_WAITTIME_SHIFT)   | \
713
 
//     (((tt)&UPPER_HINT_MASK) << SERVICE_NTIP_WAITTIME_SHIFT)   \
714
 
//   )
715
 
 
716
 
function SERVICE_NT_CCP_CODE(tt, nn: Longint): Longint;
717
 
begin
718
 
  Result := SERVICE_CCP_QUERY_HINT or nn or ((tt and LOWER_HINT_MASK) shl SERVICE_IP_WAITTIME_SHIFT) or ((tt and UPPER_HINT_MASK) shl SERVICE_NTIP_WAITTIME_SHIFT);
719
 
end;
720
 
 
721
 
// #define SERVICE_NT_WAIT_GET(code) \
722
 
//     (   \
723
 
//       (((code) & UPPER_GET_HINT_MASK) >> SERVICE_NTIP_WAITTIME_SHIFT)  |  \
724
 
//       (((code) & LOWER_GET_HINT_MASK) >> SERVICE_IP_WAITTIME_SHIFT)  \
725
 
//     )
726
 
 
727
 
function SERVICE_NT_WAIT_GET(code: DWORD): DWORD;
728
 
begin
729
 
  Result := ((code and UPPER_GET_HINT_MASK) shr SERVICE_NTIP_WAITTIME_SHIFT) or ((code and LOWER_GET_HINT_MASK) shr SERVICE_IP_WAITTIME_SHIFT);
730
 
end;
731
 
 
732
 
{$IFDEF DYNAMIC_LINK}
733
 
 
734
 
var
735
 
  _NetServiceControl: Pointer;
736
 
 
737
 
function NetServiceControl;
738
 
begin
739
 
  GetProcedureAddress(_NetServiceControl, netapi32, 'NetServiceControl');
740
 
  asm
741
 
        MOV     ESP, EBP
742
 
        POP     EBP
743
 
        JMP     [_NetServiceControl]
744
 
  end;
745
 
end;
746
 
 
747
 
var
748
 
  _NetServiceEnum: Pointer;
749
 
 
750
 
function NetServiceEnum;
751
 
begin
752
 
  GetProcedureAddress(_NetServiceEnum, netapi32, 'NetServiceEnum');
753
 
  asm
754
 
        MOV     ESP, EBP
755
 
        POP     EBP
756
 
        JMP     [_NetServiceEnum]
757
 
  end;
758
 
end;
759
 
 
760
 
var
761
 
  _NetServiceGetInfo: Pointer;
762
 
 
763
 
function NetServiceGetInfo;
764
 
begin
765
 
  GetProcedureAddress(_NetServiceGetInfo, netapi32, 'NetServiceGetInfo');
766
 
  asm
767
 
        MOV     ESP, EBP
768
 
        POP     EBP
769
 
        JMP     [_NetServiceGetInfo]
770
 
  end;
771
 
end;
772
 
 
773
 
var
774
 
  _NetServiceInstall: Pointer;
775
 
 
776
 
function NetServiceInstall;
777
 
begin
778
 
  GetProcedureAddress(_NetServiceInstall, netapi32, 'NetServiceInstall');
779
 
  asm
780
 
        MOV     ESP, EBP
781
 
        POP     EBP
782
 
        JMP     [_NetServiceInstall]
783
 
  end;
784
 
end;
785
 
 
786
 
{$ELSE}
787
 
 
788
 
function NetServiceControl; external netapi32 name 'NetServiceControl';
789
 
function NetServiceEnum; external netapi32 name 'NetServiceEnum';
790
 
function NetServiceGetInfo; external netapi32 name 'NetServiceGetInfo';
791
 
function NetServiceInstall; external netapi32 name 'NetServiceInstall';
792
 
 
793
 
{$ENDIF DYNAMIC_LINK}
794
 
 
795
 
end.
 
1
{******************************************************************************}
 
2
{                                                                              }
 
3
{ Lan Manager Service API interface Unit for Object Pascal                     }
 
4
{                                                                              }
 
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
 
6
{ Corporation. All Rights Reserved.                                            }
 
7
{                                                                              }
 
8
{ The original file is: lmsvc.h, released November 2001. The original Pascal   }
 
9
{ code is: LmSvc.pas, released Februari 2002. The initial developer of the     }
 
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl).               }
 
11
{                                                                              }
 
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
 
13
{ Marcel van Brakel. All Rights Reserved.                                      }
 
14
{                                                                              }
 
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
 
16
{                                                                              }
 
17
{ You may retrieve the latest version of this file at the Project JEDI         }
 
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
 
19
{                                                                              }
 
20
{ The contents of this file are used with permission, subject to the Mozilla   }
 
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
 
22
{ in compliance with the License. You may obtain a copy of the License at      }
 
23
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
 
24
{                                                                              }
 
25
{ Software distributed under the License is distributed on an "AS IS" basis,   }
 
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
 
27
{ the specific language governing rights and limitations under the License.    }
 
28
{                                                                              }
 
29
{ Alternatively, the contents of this file may be used under the terms of the  }
 
30
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
 
31
{ provisions of the LGPL License are applicable instead of those above.        }
 
32
{ If you wish to allow use of your version of this file only under the terms   }
 
33
{ of the LGPL License and not to allow others to use your version of this file }
 
34
{ under the MPL, indicate your decision by deleting  the provisions above and  }
 
35
{ replace  them with the notice and other provisions required by the LGPL      }
 
36
{ License.  If you do not delete the provisions above, a recipient may use     }
 
37
{ your version of this file under either the MPL or the LGPL License.          }
 
38
{                                                                              }
 
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
 
40
{                                                                              }
 
41
{******************************************************************************}
 
42
 
 
43
 
 
44
unit JwaLmSvc;
 
45
 
 
46
{$WEAKPACKAGEUNIT}
 
47
 
 
48
{$HPPEMIT ''}
 
49
{$HPPEMIT '#include "lmsvc.h"'}
 
50
{$HPPEMIT ''}
 
51
 
 
52
{$I jediapilib.inc}
 
53
 
 
54
interface
 
55
 
 
56
uses
 
57
  JwaLmCons, JwaWinType;
 
58
 
 
59
//
 
60
//  Data Structures
 
61
//
 
62
 
 
63
type
 
64
  LPSERVICE_INFO_0 = ^SERVICE_INFO_0;
 
65
  {$EXTERNALSYM LPSERVICE_INFO_0}
 
66
  PSERVICE_INFO_0 = ^SERVICE_INFO_0;
 
67
  {$EXTERNALSYM PSERVICE_INFO_0}
 
68
  _SERVICE_INFO_0 = record
 
69
    svci0_name: LPWSTR;
 
70
  end;
 
71
  {$EXTERNALSYM _SERVICE_INFO_0}
 
72
  SERVICE_INFO_0 = _SERVICE_INFO_0;
 
73
  {$EXTERNALSYM SERVICE_INFO_0}
 
74
  TServiceInfo0 = SERVICE_INFO_0;
 
75
  PServiceInfo0 = PSERVICE_INFO_0;
 
76
 
 
77
  LPSERVICE_INFO_1 = ^SERVICE_INFO_1;
 
78
  {$EXTERNALSYM LPSERVICE_INFO_1}
 
79
  PSERVICE_INFO_1 = ^SERVICE_INFO_1;
 
80
  {$EXTERNALSYM PSERVICE_INFO_1}
 
81
  _SERVICE_INFO_1 = record
 
82
    svci1_name: LPWSTR;
 
83
    svci1_status: DWORD;
 
84
    svci1_code: DWORD;
 
85
    svci1_pid: DWORD;
 
86
  end;
 
87
  {$EXTERNALSYM _SERVICE_INFO_1}
 
88
  SERVICE_INFO_1 = _SERVICE_INFO_1;
 
89
  {$EXTERNALSYM SERVICE_INFO_1}
 
90
  TServiceInfo1 = SERVICE_INFO_1;
 
91
  PServiceInfo1 = PSERVICE_INFO_1;
 
92
 
 
93
  LPSERVICE_INFO_2 = ^SERVICE_INFO_2;
 
94
  {$EXTERNALSYM LPSERVICE_INFO_2}
 
95
  PSERVICE_INFO_2 = ^SERVICE_INFO_2;
 
96
  {$EXTERNALSYM PSERVICE_INFO_2}
 
97
  _SERVICE_INFO_2 = record
 
98
    svci2_name: LPWSTR;
 
99
    svci2_status: DWORD;
 
100
    svci2_code: DWORD;
 
101
    svci2_pid: DWORD;
 
102
    svci2_text: LPWSTR;
 
103
    svci2_specific_error: DWORD;
 
104
    svci2_display_name: LPWSTR;
 
105
  end;
 
106
  {$EXTERNALSYM _SERVICE_INFO_2}
 
107
  SERVICE_INFO_2 = _SERVICE_INFO_2;
 
108
  {$EXTERNALSYM SERVICE_INFO_2}
 
109
  TServiceInfo2 = SERVICE_INFO_2;
 
110
  PServiceInfo2 = PSERVICE_INFO_2;
 
111
 
 
112
//
 
113
// Function Prototypes
 
114
//
 
115
 
 
116
function NetServiceControl(servername, service: LPCWSTR; opcode: DWORD; arg: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
 
117
{$EXTERNALSYM NetServiceControl}
 
118
 
 
119
function NetServiceEnum(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries, resume_handle: LPDWORD): NET_API_STATUS; stdcall;
 
120
{$EXTERNALSYM NetServiceEnum}
 
121
 
 
122
function NetServiceGetInfo(servername, service: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
 
123
{$EXTERNALSYM NetServiceGetInfo}
 
124
 
 
125
function NetServiceInstall(servername, service: LPCWSTR; argc: DWORD; argv: LPCWSTR; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
 
126
{$EXTERNALSYM NetServiceInstall}
 
127
 
 
128
//
 
129
// Special Values and Constants
 
130
//
 
131
 
 
132
//
 
133
//  Bitmask and bit values for svci1_status, and svci2_status
 
134
//  fields.  For each "subfield", there is a mask defined,
 
135
//  and a number of constants representing the value
 
136
//  obtained by doing (status & mask).
 
137
//
 
138
 
 
139
// Bits 0,1 -- general status
 
140
 
 
141
const
 
142
  SERVICE_INSTALL_STATE     = $03;
 
143
  {$EXTERNALSYM SERVICE_INSTALL_STATE}
 
144
  SERVICE_UNINSTALLED       = $00;
 
145
  {$EXTERNALSYM SERVICE_UNINSTALLED}
 
146
  SERVICE_INSTALL_PENDING   = $01;
 
147
  {$EXTERNALSYM SERVICE_INSTALL_PENDING}
 
148
  SERVICE_UNINSTALL_PENDING = $02;
 
149
  {$EXTERNALSYM SERVICE_UNINSTALL_PENDING}
 
150
  SERVICE_INSTALLED         = $03;
 
151
  {$EXTERNALSYM SERVICE_INSTALLED}
 
152
 
 
153
// Bits 2,3 -- paused/active status
 
154
 
 
155
  SERVICE_PAUSE_STATE           = $0C;
 
156
  {$EXTERNALSYM SERVICE_PAUSE_STATE}
 
157
  LM20_SERVICE_ACTIVE           = $00;
 
158
  {$EXTERNALSYM LM20_SERVICE_ACTIVE}
 
159
  LM20_SERVICE_CONTINUE_PENDING = $04;
 
160
  {$EXTERNALSYM LM20_SERVICE_CONTINUE_PENDING}
 
161
  LM20_SERVICE_PAUSE_PENDING    = $08;
 
162
  {$EXTERNALSYM LM20_SERVICE_PAUSE_PENDING}
 
163
  LM20_SERVICE_PAUSED           = $0C;
 
164
  {$EXTERNALSYM LM20_SERVICE_PAUSED}
 
165
 
 
166
// Bit 4 -- uninstallable indication
 
167
 
 
168
  SERVICE_NOT_UNINSTALLABLE = $00;
 
169
  {$EXTERNALSYM SERVICE_NOT_UNINSTALLABLE}
 
170
  SERVICE_UNINSTALLABLE     = $10;
 
171
  {$EXTERNALSYM SERVICE_UNINSTALLABLE}
 
172
 
 
173
// Bit 5 -- pausable indication
 
174
 
 
175
  SERVICE_NOT_PAUSABLE = $00;
 
176
  {$EXTERNALSYM SERVICE_NOT_PAUSABLE}
 
177
  SERVICE_PAUSABLE     = $20;
 
178
  {$EXTERNALSYM SERVICE_PAUSABLE}
 
179
 
 
180
// Workstation service only:
 
181
// Bits 8,9,10 -- redirection paused/active
 
182
 
 
183
  SERVICE_REDIR_PAUSED       = $700;
 
184
  {$EXTERNALSYM SERVICE_REDIR_PAUSED}
 
185
  SERVICE_REDIR_DISK_PAUSED  = $100;
 
186
  {$EXTERNALSYM SERVICE_REDIR_DISK_PAUSED}
 
187
  SERVICE_REDIR_PRINT_PAUSED = $200;
 
188
  {$EXTERNALSYM SERVICE_REDIR_PRINT_PAUSED}
 
189
  SERVICE_REDIR_COMM_PAUSED  = $400;
 
190
  {$EXTERNALSYM SERVICE_REDIR_COMM_PAUSED}
 
191
 
 
192
//
 
193
//  Additional standard LAN Manager for MS-DOS services
 
194
//
 
195
 
 
196
  SERVICE_DOS_ENCRYPTION = WideString('ENCRYPT');
 
197
  {$EXTERNALSYM SERVICE_DOS_ENCRYPTION}
 
198
 
 
199
//
 
200
//  NetServiceControl opcodes.
 
201
//
 
202
 
 
203
  SERVICE_CTRL_INTERROGATE = 0;
 
204
  {$EXTERNALSYM SERVICE_CTRL_INTERROGATE}
 
205
  SERVICE_CTRL_PAUSE       = 1;
 
206
  {$EXTERNALSYM SERVICE_CTRL_PAUSE}
 
207
  SERVICE_CTRL_CONTINUE    = 2;
 
208
  {$EXTERNALSYM SERVICE_CTRL_CONTINUE}
 
209
  SERVICE_CTRL_UNINSTALL   = 3;
 
210
  {$EXTERNALSYM SERVICE_CTRL_UNINSTALL}
 
211
 
 
212
//
 
213
//  Workstation service only:  Bits used in the "arg" parameter
 
214
//  to NetServiceControl in conjunction with the opcode
 
215
//  SERVICE_CTRL_PAUSE or SERVICE_CTRL_CONTINUE, to pause or
 
216
//  continue redirection.
 
217
//
 
218
 
 
219
  SERVICE_CTRL_REDIR_DISK  = $1;
 
220
  {$EXTERNALSYM SERVICE_CTRL_REDIR_DISK}
 
221
  SERVICE_CTRL_REDIR_PRINT = $2;
 
222
  {$EXTERNALSYM SERVICE_CTRL_REDIR_PRINT}
 
223
  SERVICE_CTRL_REDIR_COMM  = $4;
 
224
  {$EXTERNALSYM SERVICE_CTRL_REDIR_COMM}
 
225
 
 
226
//
 
227
//  Values for svci1_code, and svci2_code when status
 
228
//  of the service is SERVICE_INSTALL_PENDING or
 
229
//  SERVICE_UNINSTALL_PENDING.
 
230
//  A service can optionally provide a hint to the installer
 
231
//  that the install is proceeding and how long to wait
 
232
//  (in 0.1 second increments) before querying status again.
 
233
//
 
234
 
 
235
  SERVICE_IP_NO_HINT  = $0;
 
236
  {$EXTERNALSYM SERVICE_IP_NO_HINT}
 
237
  SERVICE_CCP_NO_HINT = $0;
 
238
  {$EXTERNALSYM SERVICE_CCP_NO_HINT}
 
239
 
 
240
  SERVICE_IP_QUERY_HINT  = $10000;
 
241
  {$EXTERNALSYM SERVICE_IP_QUERY_HINT}
 
242
  SERVICE_CCP_QUERY_HINT = $10000;
 
243
  {$EXTERNALSYM SERVICE_CCP_QUERY_HINT}
 
244
 
 
245
//
 
246
// Mask for install proceeding checkpoint number
 
247
//
 
248
 
 
249
  SERVICE_IP_CHKPT_NUM  = $0FF;
 
250
  {$EXTERNALSYM SERVICE_IP_CHKPT_NUM}
 
251
  SERVICE_CCP_CHKPT_NUM = $0FF;
 
252
  {$EXTERNALSYM SERVICE_CCP_CHKPT_NUM}
 
253
 
 
254
//
 
255
// Mask for wait time hint before querying again
 
256
//
 
257
 
 
258
  SERVICE_IP_WAIT_TIME  = $0FF00;
 
259
  {$EXTERNALSYM SERVICE_IP_WAIT_TIME}
 
260
  SERVICE_CCP_WAIT_TIME = $0FF00;
 
261
  {$EXTERNALSYM SERVICE_CCP_WAIT_TIME}
 
262
 
 
263
//
 
264
// Shift count for building wait time _code values
 
265
//
 
266
 
 
267
  SERVICE_IP_WAITTIME_SHIFT   = 8;
 
268
  {$EXTERNALSYM SERVICE_IP_WAITTIME_SHIFT}
 
269
  SERVICE_NTIP_WAITTIME_SHIFT = 12;
 
270
  {$EXTERNALSYM SERVICE_NTIP_WAITTIME_SHIFT}
 
271
 
 
272
//
 
273
// Mask used for upper and lower portions of wait hint time.
 
274
//
 
275
 
 
276
  UPPER_HINT_MASK     = $0000FF00;
 
277
  {$EXTERNALSYM UPPER_HINT_MASK}
 
278
  LOWER_HINT_MASK     = $000000FF;
 
279
  {$EXTERNALSYM LOWER_HINT_MASK}
 
280
  UPPER_GET_HINT_MASK = $0FF00000;
 
281
  {$EXTERNALSYM UPPER_GET_HINT_MASK}
 
282
  LOWER_GET_HINT_MASK = $0000FF00;
 
283
  {$EXTERNALSYM LOWER_GET_HINT_MASK}
 
284
  SERVICE_NT_MAXTIME  = $0000FFFF;
 
285
  {$EXTERNALSYM SERVICE_NT_MAXTIME}
 
286
  SERVICE_RESRV_MASK  = $0001FFFF;
 
287
  {$EXTERNALSYM SERVICE_RESRV_MASK}
 
288
  SERVICE_MAXTIME     = $000000FF;
 
289
  {$EXTERNALSYM SERVICE_MAXTIME}
 
290
 
 
291
//
 
292
//  SERVICE_BASE is the base of service error codes,
 
293
//  chosen to avoid conflict with OS, redirector,
 
294
//  netapi, and errlog codes.
 
295
//
 
296
// Don't change the comments following the manifest constants without
 
297
// understanding how mapmsg works.
 
298
//
 
299
 
 
300
  SERVICE_BASE       = 3050;
 
301
  {$EXTERNALSYM SERVICE_BASE}
 
302
  SERVICE_UIC_NORMAL = 0;
 
303
  {$EXTERNALSYM SERVICE_UIC_NORMAL}
 
304
 
 
305
{*
 
306
 *  Uninstall codes, to be used in high byte of 'code' on final NetStatus,
 
307
 *  which sets the status to UNINSTALLED.
 
308
 *}
 
309
 
 
310
  SERVICE_UIC_BADPARMVAL = SERVICE_BASE + 1;
 
311
  {$EXTERNALSYM SERVICE_UIC_BADPARMVAL}
 
312
 
 
313
{*
 
314
 * The Registry or the information you just typed includes an illegal
 
315
 * value for "%1".
 
316
 *}
 
317
 
 
318
  SERVICE_UIC_MISSPARM = SERVICE_BASE + 2;
 
319
  {$EXTERNALSYM SERVICE_UIC_MISSPARM}
 
320
 
 
321
{*
 
322
 * The required parameter was not provided on the command
 
323
 * line or in the configuration file.
 
324
 *}
 
325
 
 
326
  SERVICE_UIC_UNKPARM = SERVICE_BASE + 3;
 
327
  {$EXTERNALSYM SERVICE_UIC_UNKPARM}
 
328
 
 
329
{*
 
330
 * LAN Manager does not recognize "%1" as a valid option.
 
331
 *}
 
332
 
 
333
  SERVICE_UIC_RESOURCE = SERVICE_BASE + 4;
 
334
  {$EXTERNALSYM SERVICE_UIC_RESOURCE}
 
335
 
 
336
{*
 
337
 * A request for resource could not be satisfied.
 
338
 *}
 
339
 
 
340
  SERVICE_UIC_CONFIG = SERVICE_BASE + 5;
 
341
  {$EXTERNALSYM SERVICE_UIC_CONFIG}
 
342
 
 
343
{*
 
344
 * A problem exists with the system configuration.
 
345
 *}
 
346
 
 
347
  SERVICE_UIC_SYSTEM = SERVICE_BASE + 6;
 
348
  {$EXTERNALSYM SERVICE_UIC_SYSTEM}
 
349
 
 
350
{*
 
351
 * A system error has occurred.
 
352
 *}
 
353
 
 
354
  SERVICE_UIC_INTERNAL = SERVICE_BASE + 7;
 
355
  {$EXTERNALSYM SERVICE_UIC_INTERNAL}
 
356
 
 
357
{*
 
358
 * An internal consistency error has occurred.
 
359
 *}
 
360
 
 
361
  SERVICE_UIC_AMBIGPARM = SERVICE_BASE + 8;
 
362
  {$EXTERNALSYM SERVICE_UIC_AMBIGPARM}
 
363
 
 
364
{*
 
365
 * The configuration file or the command line has an ambiguous option.
 
366
 *}
 
367
 
 
368
  SERVICE_UIC_DUPPARM = SERVICE_BASE + 9;
 
369
  {$EXTERNALSYM SERVICE_UIC_DUPPARM}
 
370
 
 
371
{*
 
372
 * The configuration file or the command line has a duplicate parameter.
 
373
 *}
 
374
 
 
375
  SERVICE_UIC_KILL = SERVICE_BASE + 10;
 
376
  {$EXTERNALSYM SERVICE_UIC_KILL}
 
377
 
 
378
{*
 
379
 * The service did not respond to control and was stopped with
 
380
 * the DosKillProc function.
 
381
 *}
 
382
 
 
383
  SERVICE_UIC_EXEC = SERVICE_BASE + 11;
 
384
  {$EXTERNALSYM SERVICE_UIC_EXEC}
 
385
 
 
386
{*
 
387
 * An error occurred when attempting to run the service program.
 
388
 *}
 
389
 
 
390
  SERVICE_UIC_SUBSERV = SERVICE_BASE + 12;
 
391
  {$EXTERNALSYM SERVICE_UIC_SUBSERV}
 
392
 
 
393
{*
 
394
 * The sub-service failed to start.
 
395
 *}
 
396
 
 
397
  SERVICE_UIC_CONFLPARM = SERVICE_BASE + 13;
 
398
  {$EXTERNALSYM SERVICE_UIC_CONFLPARM}
 
399
 
 
400
{*
 
401
 * There is a conflict in the value or use of these options: %1.
 
402
 *}
 
403
 
 
404
  SERVICE_UIC_FILE = SERVICE_BASE + 14;
 
405
  {$EXTERNALSYM SERVICE_UIC_FILE}
 
406
 
 
407
{*
 
408
 * There is a problem with the file.
 
409
 *}
 
410
 
 
411
//
 
412
//  The modifiers
 
413
//
 
414
 
 
415
//
 
416
// General:
 
417
//
 
418
 
 
419
  SERVICE_UIC_M_NULL = 0;
 
420
  {$EXTERNALSYM SERVICE_UIC_M_NULL}
 
421
 
 
422
//
 
423
//  RESOURCE:
 
424
//
 
425
 
 
426
  SERVICE_UIC_M_MEMORY    = SERVICE_BASE + 20; // memory
 
427
  {$EXTERNALSYM SERVICE_UIC_M_MEMORY}
 
428
  SERVICE_UIC_M_DISK      = SERVICE_BASE + 21; // disk space
 
429
  {$EXTERNALSYM SERVICE_UIC_M_DISK}
 
430
  SERVICE_UIC_M_THREADS   = SERVICE_BASE + 22; // thread
 
431
  {$EXTERNALSYM SERVICE_UIC_M_THREADS}
 
432
  SERVICE_UIC_M_PROCESSES = SERVICE_BASE + 23; // process
 
433
  {$EXTERNALSYM SERVICE_UIC_M_PROCESSES}
 
434
 
 
435
//
 
436
//  CONFIG:
 
437
//
 
438
 
 
439
//
 
440
// Security failure
 
441
//
 
442
 
 
443
  SERVICE_UIC_M_SECURITY = SERVICE_BASE + 24;
 
444
  {$EXTERNALSYM SERVICE_UIC_M_SECURITY}
 
445
 
 
446
{* Security Failure. %0 *}
 
447
 
 
448
  SERVICE_UIC_M_LANROOT = SERVICE_BASE + 25;
 
449
  {$EXTERNALSYM SERVICE_UIC_M_LANROOT}
 
450
 
 
451
{*
 
452
 * Bad or missing LAN Manager root directory.
 
453
 *}
 
454
 
 
455
  SERVICE_UIC_M_REDIR = SERVICE_BASE + 26;
 
456
  {$EXTERNALSYM SERVICE_UIC_M_REDIR}
 
457
 
 
458
{*
 
459
 * The network software is not installed.
 
460
 *}
 
461
 
 
462
  SERVICE_UIC_M_SERVER = SERVICE_BASE + 27;
 
463
  {$EXTERNALSYM SERVICE_UIC_M_SERVER}
 
464
 
 
465
{*
 
466
 * The server is not started.
 
467
 *}
 
468
 
 
469
  SERVICE_UIC_M_SEC_FILE_ERR = SERVICE_BASE + 28;
 
470
  {$EXTERNALSYM SERVICE_UIC_M_SEC_FILE_ERR}
 
471
 
 
472
{*
 
473
 * The server cannot access the user accounts database (NET.ACC).
 
474
 *}
 
475
 
 
476
  SERVICE_UIC_M_FILES = SERVICE_BASE + 29;
 
477
  {$EXTERNALSYM SERVICE_UIC_M_FILES}
 
478
 
 
479
{*
 
480
 * Incompatible files are installed in the LANMAN tree.
 
481
 *}
 
482
 
 
483
  SERVICE_UIC_M_LOGS = SERVICE_BASE + 30;
 
484
  {$EXTERNALSYM SERVICE_UIC_M_LOGS}
 
485
 
 
486
{*
 
487
 * The LANMAN\LOGS directory is invalid.
 
488
 *}
 
489
 
 
490
  SERVICE_UIC_M_LANGROUP = SERVICE_BASE + 31;
 
491
  {$EXTERNALSYM SERVICE_UIC_M_LANGROUP}
 
492
 
 
493
{*
 
494
 * The domain specified could not be used.
 
495
 *}
 
496
 
 
497
  SERVICE_UIC_M_MSGNAME = SERVICE_BASE + 32;
 
498
  {$EXTERNALSYM SERVICE_UIC_M_MSGNAME}
 
499
 
 
500
{*
 
501
 * The computer name is being used as a message alias on another computer.
 
502
 *}
 
503
 
 
504
  SERVICE_UIC_M_ANNOUNCE = SERVICE_BASE + 33;
 
505
  {$EXTERNALSYM SERVICE_UIC_M_ANNOUNCE}
 
506
 
 
507
{*
 
508
 * The announcement of the server name failed.
 
509
 *}
 
510
 
 
511
  SERVICE_UIC_M_UAS = SERVICE_BASE + 34;
 
512
  {$EXTERNALSYM SERVICE_UIC_M_UAS}
 
513
 
 
514
{*
 
515
 * The user accounts database is not configured correctly.
 
516
 *}
 
517
 
 
518
  SERVICE_UIC_M_SERVER_SEC_ERR = SERVICE_BASE + 35;
 
519
  {$EXTERNALSYM SERVICE_UIC_M_SERVER_SEC_ERR}
 
520
 
 
521
{*
 
522
 * The server is not running with user-level security.
 
523
 *}
 
524
 
 
525
  SERVICE_UIC_M_WKSTA = SERVICE_BASE + 37;
 
526
  {$EXTERNALSYM SERVICE_UIC_M_WKSTA}
 
527
 
 
528
{*
 
529
 * The workstation is not configured properly.
 
530
 *}
 
531
 
 
532
  SERVICE_UIC_M_ERRLOG = SERVICE_BASE + 38;
 
533
  {$EXTERNALSYM SERVICE_UIC_M_ERRLOG}
 
534
 
 
535
{*
 
536
 * View your error log for details.
 
537
 *}
 
538
 
 
539
  SERVICE_UIC_M_FILE_UW = SERVICE_BASE + 39;
 
540
  {$EXTERNALSYM SERVICE_UIC_M_FILE_UW}
 
541
 
 
542
{*
 
543
 * Unable to write to this file.
 
544
 *}
 
545
 
 
546
  SERVICE_UIC_M_ADDPAK = SERVICE_BASE + 40;
 
547
  {$EXTERNALSYM SERVICE_UIC_M_ADDPAK}
 
548
 
 
549
{*
 
550
 * ADDPAK file is corrupted.  Delete LANMAN\NETPROG\ADDPAK.SER
 
551
 * and reapply all ADDPAKs.
 
552
 *}
 
553
 
 
554
  SERVICE_UIC_M_LAZY = SERVICE_BASE + 41;
 
555
  {$EXTERNALSYM SERVICE_UIC_M_LAZY}
 
556
 
 
557
{*
 
558
 * The LM386 server cannot be started because CACHE.EXE is not running.
 
559
 *}
 
560
 
 
561
  SERVICE_UIC_M_UAS_MACHINE_ACCT = SERVICE_BASE + 42;
 
562
  {$EXTERNALSYM SERVICE_UIC_M_UAS_MACHINE_ACCT}
 
563
 
 
564
{*
 
565
 * There is no account for this computer in the security database.
 
566
 *}
 
567
 
 
568
  SERVICE_UIC_M_UAS_SERVERS_NMEMB = SERVICE_BASE + 43;
 
569
  {$EXTERNALSYM SERVICE_UIC_M_UAS_SERVERS_NMEMB}
 
570
 
 
571
{*
 
572
 * This computer is not a member of the group SERVERS.
 
573
 *}
 
574
 
 
575
  SERVICE_UIC_M_UAS_SERVERS_NOGRP = SERVICE_BASE + 44;
 
576
  {$EXTERNALSYM SERVICE_UIC_M_UAS_SERVERS_NOGRP}
 
577
 
 
578
{*
 
579
 * The group SERVERS is not present in the local security database.
 
580
 *}
 
581
 
 
582
  SERVICE_UIC_M_UAS_INVALID_ROLE = SERVICE_BASE + 45;
 
583
  {$EXTERNALSYM SERVICE_UIC_M_UAS_INVALID_ROLE}
 
584
 
 
585
{*
 
586
 * This computer is configured as a member of a workgroup, not as
 
587
 * a member of a domain. The Netlogon service does not need to run in this
 
588
 * configuration.
 
589
 *}
 
590
 
 
591
  SERVICE_UIC_M_NETLOGON_NO_DC = SERVICE_BASE + 46;
 
592
  {$EXTERNALSYM SERVICE_UIC_M_NETLOGON_NO_DC}
 
593
 
 
594
{*
 
595
 * The primary Domain Controller for this domain could not be located.
 
596
 *}
 
597
 
 
598
  SERVICE_UIC_M_NETLOGON_DC_CFLCT = SERVICE_BASE + 47;
 
599
  {$EXTERNALSYM SERVICE_UIC_M_NETLOGON_DC_CFLCT}
 
600
 
 
601
{*
 
602
 * This computer is configured to be the primary domain controller of its domain.
 
603
 * However, the computer %1 is currently claiming to be the primary domain controller
 
604
 * of the domain.
 
605
 *}
 
606
 
 
607
  SERVICE_UIC_M_NETLOGON_AUTH = SERVICE_BASE + 48;
 
608
  {$EXTERNALSYM SERVICE_UIC_M_NETLOGON_AUTH}
 
609
 
 
610
{*
 
611
 * The service failed to authenticate with the primary domain controller.
 
612
 *}
 
613
 
 
614
  SERVICE_UIC_M_UAS_PROLOG = SERVICE_BASE + 49;
 
615
  {$EXTERNALSYM SERVICE_UIC_M_UAS_PROLOG}
 
616
 
 
617
{*
 
618
 * There is a problem with the security database creation date or serial number.
 
619
 *}
 
620
 
 
621
  SERVICE2_BASE = 5600;
 
622
  {$EXTERNALSYM SERVICE2_BASE}
 
623
 
 
624
{* new SEVICE_UIC messages go here *}
 
625
 
 
626
  SERVICE_UIC_M_NETLOGON_MPATH = SERVICE2_BASE + 0;
 
627
  {$EXTERNALSYM SERVICE_UIC_M_NETLOGON_MPATH}
 
628
 
 
629
{*
 
630
 * Could not share the User or Script path.
 
631
 *}
 
632
 
 
633
  SERVICE_UIC_M_LSA_MACHINE_ACCT = SERVICE2_BASE + 1;
 
634
  {$EXTERNALSYM SERVICE_UIC_M_LSA_MACHINE_ACCT}
 
635
 
 
636
{*
 
637
 * The password for this computer is not found in the local security
 
638
 * database.
 
639
 *}
 
640
 
 
641
  SERVICE_UIC_M_DATABASE_ERROR = SERVICE2_BASE + 2;
 
642
  {$EXTERNALSYM SERVICE_UIC_M_DATABASE_ERROR}
 
643
 
 
644
{*
 
645
 * An internal error occurred while accessing the computer's
 
646
 * local or network security database.
 
647
 *}
 
648
 
 
649
//
 
650
//  End modifiers
 
651
//
 
652
 
 
653
//
 
654
// Commonly used Macros:
 
655
//
 
656
 
 
657
function SERVICE_IP_CODE(tt, nn: LONG): LONG;
 
658
{$EXTERNALSYM SERVICE_IP_CODE}
 
659
 
 
660
function SERVICE_CCP_CODE(tt, nn: LONG): LONG;
 
661
{$EXTERNALSYM SERVICE_CCP_CODE}
 
662
 
 
663
function SERVICE_UIC_CODE(cc, mm: LONG): LONG;
 
664
{$EXTERNALSYM SERVICE_UIC_CODE}
 
665
 
 
666
//
 
667
// This macro takes a wait hint (tt) which can have a maximum value of
 
668
// 0xFFFF and puts it into the service status code field.
 
669
// 0x0FF1FFnn  (where nn is the checkpoint information).
 
670
//
 
671
 
 
672
function SERVICE_NT_CCP_CODE(tt, nn: LONG): LONG;
 
673
{$EXTERNALSYM SERVICE_NT_CCP_CODE}
 
674
 
 
675
//
 
676
// This macro takes a status code field, and strips out the wait hint
 
677
// from the upper and lower sections.
 
678
// 0x0FF1FFnn results in 0x0000FFFF.
 
679
//
 
680
 
 
681
function SERVICE_NT_WAIT_GET(code: DWORD): DWORD;
 
682
{$EXTERNALSYM SERVICE_NT_WAIT_GET}
 
683
 
 
684
implementation
 
685
 
 
686
// #define SERVICE_IP_CODE(tt,nn) ((long)SERVICE_IP_QUERY_HINT|(long)(nn|(tt<<SERVICE_IP_WAITTIME_SHIFT)))
 
687
 
 
688
function SERVICE_IP_CODE(tt, nn: LONG): LONG;
 
689
begin
 
690
  Result := SERVICE_IP_QUERY_HINT or (nn or (tt shl SERVICE_IP_WAITTIME_SHIFT));
 
691
end;
 
692
 
 
693
// #define SERVICE_CCP_CODE(tt,nn) ((long)SERVICE_CCP_QUERY_HINT|(long)(nn|(tt<<SERVICE_IP_WAITTIME_SHIFT)))
 
694
 
 
695
function SERVICE_CCP_CODE(tt, nn: LONG): LONG;
 
696
begin
 
697
  Result := SERVICE_CCP_QUERY_HINT or (nn or (tt shl SERVICE_IP_WAITTIME_SHIFT));
 
698
end;
 
699
 
 
700
// #define SERVICE_UIC_CODE(cc,mm) ((long)(((long)cc<<16)|(long)(unsigned short)mm))
 
701
 
 
702
function SERVICE_UIC_CODE(cc, mm: LONG): LONG;
 
703
begin
 
704
  Result := (cc shl 16) or WORD(mm);
 
705
end;
 
706
 
 
707
// #define SERVICE_NT_CCP_CODE(tt,nn)  \
 
708
//   (  \
 
709
//     ((long)SERVICE_CCP_QUERY_HINT)   | \
 
710
//     ((long)(nn))   | \
 
711
//     (((tt)&LOWER_HINT_MASK) << SERVICE_IP_WAITTIME_SHIFT)   | \
 
712
//     (((tt)&UPPER_HINT_MASK) << SERVICE_NTIP_WAITTIME_SHIFT)   \
 
713
//   )
 
714
 
 
715
function SERVICE_NT_CCP_CODE(tt, nn: Longint): Longint;
 
716
begin
 
717
  Result := SERVICE_CCP_QUERY_HINT or nn or ((tt and LOWER_HINT_MASK) shl SERVICE_IP_WAITTIME_SHIFT) or ((tt and UPPER_HINT_MASK) shl SERVICE_NTIP_WAITTIME_SHIFT);
 
718
end;
 
719
 
 
720
// #define SERVICE_NT_WAIT_GET(code) \
 
721
//     (   \
 
722
//       (((code) & UPPER_GET_HINT_MASK) >> SERVICE_NTIP_WAITTIME_SHIFT)  |  \
 
723
//       (((code) & LOWER_GET_HINT_MASK) >> SERVICE_IP_WAITTIME_SHIFT)  \
 
724
//     )
 
725
 
 
726
function SERVICE_NT_WAIT_GET(code: DWORD): DWORD;
 
727
begin
 
728
  Result := ((code and UPPER_GET_HINT_MASK) shr SERVICE_NTIP_WAITTIME_SHIFT) or ((code and LOWER_GET_HINT_MASK) shr SERVICE_IP_WAITTIME_SHIFT);
 
729
end;
 
730
 
 
731
{$IFDEF DYNAMIC_LINK}
 
732
 
 
733
var
 
734
  _NetServiceControl: Pointer;
 
735
 
 
736
function NetServiceControl;
 
737
begin
 
738
  GetProcedureAddress(_NetServiceControl, netapi32, 'NetServiceControl');
 
739
  asm
 
740
        MOV     ESP, EBP
 
741
        POP     EBP
 
742
        JMP     [_NetServiceControl]
 
743
  end;
 
744
end;
 
745
 
 
746
var
 
747
  _NetServiceEnum: Pointer;
 
748
 
 
749
function NetServiceEnum;
 
750
begin
 
751
  GetProcedureAddress(_NetServiceEnum, netapi32, 'NetServiceEnum');
 
752
  asm
 
753
        MOV     ESP, EBP
 
754
        POP     EBP
 
755
        JMP     [_NetServiceEnum]
 
756
  end;
 
757
end;
 
758
 
 
759
var
 
760
  _NetServiceGetInfo: Pointer;
 
761
 
 
762
function NetServiceGetInfo;
 
763
begin
 
764
  GetProcedureAddress(_NetServiceGetInfo, netapi32, 'NetServiceGetInfo');
 
765
  asm
 
766
        MOV     ESP, EBP
 
767
        POP     EBP
 
768
        JMP     [_NetServiceGetInfo]
 
769
  end;
 
770
end;
 
771
 
 
772
var
 
773
  _NetServiceInstall: Pointer;
 
774
 
 
775
function NetServiceInstall;
 
776
begin
 
777
  GetProcedureAddress(_NetServiceInstall, netapi32, 'NetServiceInstall');
 
778
  asm
 
779
        MOV     ESP, EBP
 
780
        POP     EBP
 
781
        JMP     [_NetServiceInstall]
 
782
  end;
 
783
end;
 
784
 
 
785
{$ELSE}
 
786
 
 
787
function NetServiceControl; external netapi32 name 'NetServiceControl';
 
788
function NetServiceEnum; external netapi32 name 'NetServiceEnum';
 
789
function NetServiceGetInfo; external netapi32 name 'NetServiceGetInfo';
 
790
function NetServiceInstall; external netapi32 name 'NetServiceInstall';
 
791
 
 
792
{$ENDIF DYNAMIC_LINK}
 
793
 
 
794
end.