-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.go
1891 lines (1822 loc) · 156 KB
/
server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package svcctl
import (
"context"
"fmt"
"strings"
"unicode/utf16"
dcerpc "github.com/oiweiwei/go-msrpc/dcerpc"
errors "github.com/oiweiwei/go-msrpc/dcerpc/errors"
uuid "github.com/oiweiwei/go-msrpc/midl/uuid"
ndr "github.com/oiweiwei/go-msrpc/ndr"
)
var (
_ = context.Background
_ = fmt.Errorf
_ = utf16.Encode
_ = strings.TrimPrefix
_ = ndr.ZeroString
_ = (*uuid.UUID)(nil)
_ = (*dcerpc.SyntaxID)(nil)
_ = (*errors.Error)(nil)
)
// svcctl server interface.
type SvcctlServer interface {
// The RCloseServiceHandle method is called by the client. In response, the server releases
// the handle to the specified service or the SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns the following error code.
//
// +------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +------------------------+----------------------------------------------------------------------------------+
// +------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +------------------------+----------------------------------------------------------------------------------+
// | 0xFFFF75FD | The operation completed successfully. Additionally, the passed handle was the |
// | | last one created for the associated service record that was previously used in a |
// | | successful call to the RNotifyServiceStatusChange (section 3.1.4.43) method. |
// +------------------------+----------------------------------------------------------------------------------+
// | 0xFFFF75FE | The operation completed successfully. Additionally, the passed handle was |
// | | previously used in a successful call to the RNotifyServiceStatusChange method. |
// +------------------------+----------------------------------------------------------------------------------+
CloseService(context.Context, *CloseServiceRequest) (*CloseServiceResponse, error)
// The RControlService method receives a control code for a specific service handle,
// as specified by the client.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +---------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------------+----------------------------------------------------------------------------------+
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The required access right had not been granted to the caller when the RPC |
// | | context handle to the service record was created. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1051 ERROR_DEPENDENT_SERVICES_RUNNING | The service cannot be stopped because other running services are dependent on |
// | | it. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | The requested control code is undefined |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1052 ERROR_INVALID_SERVICE_CONTROL | The requested control code is not valid, or it is unacceptable to the service. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1053 ERROR_SERVICE_REQUEST_TIMEOUT | The process for the service was started, but it did not respond within an |
// | | implementation-specific time-out.<35> |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1061 ERROR_SERVICE_CANNOT_ACCEPT_CTRL | The requested control code cannot be sent to the service because the |
// | | ServiceStatus.dwCurrentState in the service record is SERVICE_START_PENDING or |
// | | SERVICE_STOP_PENDING. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1062 ERROR_SERVICE_NOT_ACTIVE | The service has not been started, or the ServiceStatus.dwCurrentState in the |
// | | service record is SERVICE_STOPPED. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +---------------------------------------+----------------------------------------------------------------------------------+
ControlService(context.Context, *ControlServiceRequest) (*ControlServiceResponse, error)
// The RDeleteService method marks the specified service for deletion from the SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The DELETE access right had not been granted to the caller when the RPC context |
// | | handle to the service record was created. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The RDeleteService has already been called for the service record identified by |
// | | the hService parameter. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +--------------------------------------+----------------------------------------------------------------------------------+
DeleteService(context.Context, *DeleteServiceRequest) (*DeleteServiceResponse, error)
// The RLockServiceDatabase method acquires a lock on an SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +------------------------------------+----------------------------------------------------------------------------------+
// +------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SC_MANAGER_LOCK access rights had not been granted to the caller when the |
// | | RPC context handle was created. |
// +------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +------------------------------------+----------------------------------------------------------------------------------+
// | 1055 ERROR_SERVICE_DATABASE_LOCKED | The service database is locked. |
// +------------------------------------+----------------------------------------------------------------------------------+
LockServiceDatabase(context.Context, *LockServiceDatabaseRequest) (*LockServiceDatabaseResponse, error)
// The RQueryServiceObjectSecurity method returns a copy of the SECURITY_DESCRIPTOR
// structure associated with a service object.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-------------------------------+----------------------------------------------------------------------------------+
// +-------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The required access rights had not been granted to the caller when the RPC |
// | | context handle was created. |
// +-------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +-------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +-------------------------------+----------------------------------------------------------------------------------+
// | 122 ERROR_INSUFFICIENT_BUFFER | The data area passed to a system call is too small. |
// +-------------------------------+----------------------------------------------------------------------------------+
//
// The client MAY provide a combination of one or more SECURITY_INFORMATION bit flags
// for dwSecurityInformation.
//
// If SACL_SECURITY_INFORMATION is specified for the dwSecurityInformation parameter,
// then an ACCESS_SYSTEM_SECURITY right MUST have been granted to the caller when hService
// was created. (See AS in ACCESS_MASK in [MS-DTYP] 2.4.3.)
//
// If DACL_SECURITY_INFORMATION, LABEL_SECURITY_INFORMATION, OWNER_SECURITY_INFORMATION,
// or GROUP_SECURITY_INFORMATION is specified for the dwSecurityInformation parameter,
// then a READ_CONTROL right MUST have been granted to the caller when hService was
// created. (See RC in ACCESS_MASK in [MS-DTYP] 2.4.3.)
QueryServiceObjectSecurity(context.Context, *QueryServiceObjectSecurityRequest) (*QueryServiceObjectSecurityResponse, error)
// The RSetServiceObjectSecurity method sets the SECURITY_DESCRIPTOR structure associated
// with a service object.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The required access rights had not been granted to the caller when the RPC |
// | | context handle was created. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The RDeleteService method has been called with an RPC context handle identifying |
// | | the same service record as the hService parameter for this call. |
// +--------------------------------------+----------------------------------------------------------------------------------+
//
// The client MAY provide a combination of one or more SECURITY_INFORMATION bit flags
// for dwSecurityInformation.
//
// If SACL_SECURITY_INFORMATION is specified via dwSecurityInformation, then an ACCESS_SYSTEM_SECURITY
// right MUSThave been granted to the caller when hService was created. (See WD in ACCESS_MASK
// in [MS-DTYP] 2.4.3.
//
// If LABEL_SECURITY_INFORMATION or OWNER_SECURITY_INFORMATION or GROUP_SECURITY_INFORMATION
// is specified via dwSecurityInformation, then a WRITE_OWNER right MUST have been granted
// to the caller when hService was created. (See WO in ACCESS_MASK in [MS-DTYP] 2.4.3.)
//
// If DACL_SECURITY_INFORMATION is specified via dwSecurityInformation, then a WRITE_DAC
// right MUST have been granted to the caller when hService was created. (See WD in
// ACCESS_MASK in [MS-DTYP] 2.4.3.)
SetServiceObjectSecurity(context.Context, *SetServiceObjectSecurityRequest) (*SetServiceObjectSecurityResponse, error)
// The RQueryServiceStatus method returns the current status of the specified service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +---------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------+----------------------------------------------------------------------------------+
// +---------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_QUERY_STATUS access right had not been granted to the caller when |
// | | the RPC context handle was created. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 3 ERROR_PATH_NOT_FOUND | The ImagePath of the service record identified by the hService parameter does |
// | | not exist. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +---------------------------------+----------------------------------------------------------------------------------+
//
// If the type of the service record is SERVICE_KERNEL_DRIVER or SERVICE_FILESYSTEM_DRIVER,
// the SCM queries the current status of the driver from the operating system and set
// the ServiceStatus.dwCurrentState of the service record to SERVICE_RUNNING if driver
// is loaded and to SERVICE_STOPPED if it is not.
QueryServiceStatus(context.Context, *QueryServiceStatusRequest) (*QueryServiceStatusResponse, error)
// The RSetServiceStatus method updates the SCM status information for the calling service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +------------------------+----------------------------------------------------------------------------------+
// +------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | Either the handle is no longer valid or the SERVICE_SET_STATUS access rights had |
// | | not been granted to the caller when the RPC context handle was created. |
// +------------------------+----------------------------------------------------------------------------------+
// | 13 ERROR_INVALID_DATA | The data provided in the lpServiceStatus parameter is invalid. |
// +------------------------+----------------------------------------------------------------------------------+
SetServiceStatus(context.Context, *SetServiceStatusRequest) (*SetServiceStatusResponse, error)
// The RUnlockServiceDatabase method releases a lock on a service database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns the following error code.
//
// +---------------------------------+----------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------+----------------------------------------------+
// +---------------------------------+----------------------------------------------+
// | 1071 ERROR_INVALID_SERVICE_LOCK | The specified RPC context handle is invalid. |
// +---------------------------------+----------------------------------------------+
UnlockServiceDatabase(context.Context, *UnlockServiceDatabaseRequest) (*UnlockServiceDatabaseResponse, error)
// The RNotifyBootConfigStatus method reports the boot status to the SCM.
//
// Return Values: The method returns ERROR_SUCCESS (0x00000000) on success; otherwise,
// it returns one of the following error codes.
//
// +----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------------+----------------------------------------------------------------------------------+
// +----------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The caller does not have the SC_MANAGER_MODIFY_BOOT_CONFIG access rights granted |
// | | in the SCM Security Descriptor. |
// +----------------------------------+----------------------------------------------------------------------------------+
// | 1074 ERROR_ALREADY_RUNNING_LKG | The system is currently running with the last-known-good configuration. |
// +----------------------------------+----------------------------------------------------------------------------------+
// | 1076 ERROR_BOOT_ALREADY_ACCEPTED | The BootAccepted field of the SCM on the target machine indicated that a |
// | | successful call to RNotifyBootConfigStatus has already been made. |
// +----------------------------------+----------------------------------------------------------------------------------+
NotifyBootConfigStatus(context.Context, *NotifyBootConfigStatusRequest) (*NotifyBootConfigStatusResponse, error)
// Opnum10NotUsedOnWire operation.
// Opnum10NotUsedOnWire
// The RChangeServiceConfigW method changes a service's configuration parameters in
// the SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise
// it returns one of the following error codes.
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_CHANGE_CONFIG access right had not been granted to the caller when |
// | | the RPC context handle to the service record was created. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1057 ERROR_INVALID_SERVICE_ACCOUNT | The user account name specified in the lpServiceStartName parameter does not |
// | | exist. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1059 ERROR_CIRCULAR_DEPENDENCY | A circular service dependency was specified. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1078 ERROR_DUPLICATE_SERVICE_NAME | The lpDisplayName matches either the ServiceName or the DisplayName of another |
// | | service record in the service control manager database. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The RDeleteService has been called for the service record identified by the |
// | | hService parameter. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +--------------------------------------+----------------------------------------------------------------------------------+
ChangeServiceConfigW(context.Context, *ChangeServiceConfigWRequest) (*ChangeServiceConfigWResponse, error)
// The RCreateServiceW method creates the service record in the SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SC_MANAGER_CREATE_SERVICE access right had not been granted to the caller |
// | | when the RPC context handle was created. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 13 ERROR_INVALID_DATA | The data is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The specified service name is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1057 ERROR_INVALID_SERVICE_ACCOUNT | The user account name specified in the lpServiceStartName parameter does not |
// | | exist. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1059 ERROR_CIRCULAR_DEPENDENCY | A circular service dependency was specified. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The service record with a specified name already exists and RDeleteService has |
// | | been called for it. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1073 ERROR_SERVICE_EXISTS | The service record with the ServiceName matching the specified lpServiceName |
// | | already exists. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1078 ERROR_DUPLICATE_SERVICE_NAME | The service record with the same DisplayName or the same ServiceName as the |
// | | passed in lpDisplayName already exists in the service control manager database. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +--------------------------------------+----------------------------------------------------------------------------------+
CreateServiceW(context.Context, *CreateServiceWRequest) (*CreateServiceWResponse, error)
// The REnumDependentServicesW method returns the ServiceName, DisplayName, and ServiceStatus
// values of service records that are listed as dependents of a specified service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +---------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------+----------------------------------------------------------------------------------+
// +---------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_ENUMERATE_DEPENDENT access right had not been granted to the caller |
// | | when the RPC context handle to the service record was created. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 234 ERROR_MORE_DATA | More data is available. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +---------------------------------+----------------------------------------------------------------------------------+
EnumDependentServicesW(context.Context, *EnumDependentServicesWRequest) (*EnumDependentServicesWResponse, error)
// The REnumServicesStatusW method enumerates service records in the specified SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +----------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------+----------------------------------------------------------------------------------+
// +----------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SM_MANAGER_ENUMERATE_SERVICE access right had not been granted to the caller |
// | | when the RPC context handle to the service record was created. |
// +----------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +----------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +----------------------------+----------------------------------------------------------------------------------+
// | 234 ERROR_MORE_DATA | More data is available. |
// +----------------------------+----------------------------------------------------------------------------------+
EnumServicesStatusW(context.Context, *EnumServicesStatusWRequest) (*EnumServicesStatusWResponse, error)
// The ROpenSCManagerW method establishes a connection to server and opens the SCM database
// on the specified server.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +------------------------------------+----------------------------------------------------------------------------------+
// +------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The client does not have the required access rights to open the SCM |
// | | database on the server or the desired access is not granted to it in the SCM |
// | | SecurityDescriptor. |
// +------------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The specified service name is invalid. |
// +------------------------------------+----------------------------------------------------------------------------------+
// | 1065 ERROR_DATABASE_DOES_NOT_EXIST | The database specified does not exist. |
// +------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +------------------------------------+----------------------------------------------------------------------------------+
OpenSCMW(context.Context, *OpenSCMWRequest) (*OpenSCMWResponse, error)
// The ROpenServiceW method creates an RPC context handle to an existing service record.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The access specified by the dwDesiredAccess parameter cannot be granted to the |
// | | caller. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The specified service name is invalid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1060 ERROR_SERVICE_DOES_NOT_EXIST | The service record with a specified DisplayName does not exist in the SCM |
// | | database. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +-----------------------------------+----------------------------------------------------------------------------------+
OpenServiceW(context.Context, *OpenServiceWRequest) (*OpenServiceWResponse, error)
// The RQueryServiceConfigW method returns the configuration parameters of the specified
// service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +---------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------+----------------------------------------------------------------------------------+
// +---------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_QUERY_CONFIG access right had not been granted to the caller when |
// | | the RPC context handle was created. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 122 ERROR_INSUFFICIENT_BUFFER | The data area passed to a system call is too small. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +---------------------------------+----------------------------------------------------------------------------------+
QueryServiceConfigW(context.Context, *QueryServiceConfigWRequest) (*QueryServiceConfigWResponse, error)
// The RQueryServiceLockStatusW method returns the lock status of the specified SCM
// database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-------------------------------+----------------------------------------------------------------------------------+
// +-------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SC_MANAGER_QUERY_LOCK_STATUS access right had not been granted to the caller |
// | | when the RPC context handle was created. |
// +-------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +-------------------------------+----------------------------------------------------------------------------------+
// | 122 ERROR_INSUFFICIENT_BUFFER | The data area passed to a system call is too small. |
// +-------------------------------+----------------------------------------------------------------------------------+
QueryServiceLockStatusW(context.Context, *QueryServiceLockStatusWRequest) (*QueryServiceLockStatusWResponse, error)
// The RStartServiceW method starts a specified service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.<41>
//
// +---------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------------+----------------------------------------------------------------------------------+
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 2 ERROR_FILE_NOT_FOUND | The system cannot find the file specified. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 3 ERROR_PATH_NOT_FOUND | The system cannot find the path specified. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_START access right had not been granted to the caller when the RPC |
// | | context handle to the service record was created. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1053 ERROR_SERVICE_REQUEST_TIMEOUT | The process for the service was started, but it did not respond within an |
// | | implementation-specific time-out.<42> |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1054 ERROR_SERVICE_NO_THREAD | A thread could not be created for the service. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1055 ERROR_SERVICE_DATABASE_LOCKED | The service database is locked by the call to the BlockServiceDatabase |
// | | method.<43> |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1056 ERROR_SERVICE_ALREADY_RUNNING | The ServiceStatus.dwCurrentState in the service record is not set to |
// | | SERVICE_STOPPED. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1058 ERROR_SERVICE_DISABLED | The service cannot be started because the Start field in the service record is |
// | | set to SERVICE_DISABLED. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1068 ERROR_SERVICE_DEPENDENCY_FAIL | The specified service depends on another service that has failed to start. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1069 ERROR_SERVICE_LOGON_FAILED | The service did not start due to a logon failure. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The RDeleteService method has been called for the service record identified by |
// | | the hService parameter. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1075 ERROR_SERVICE_DEPENDENCY_DELETED | The specified service depends on a service that does not exist or has been |
// | | marked for deletion. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +---------------------------------------+----------------------------------------------------------------------------------+
StartServiceW(context.Context, *StartServiceWRequest) (*StartServiceWResponse, error)
// The RGetServiceDisplayNameW method returns the display name of the specified service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 122 ERROR_INSUFFICIENT_BUFFER | The display name does not fit in the buffer. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The specified service name is invalid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1060 ERROR_SERVICE_DOES_NOT_EXIST | The service record with the specified ServiceName does not exist in the SCM |
// | | database identified by the hSCManager parameter. |
// +-----------------------------------+----------------------------------------------------------------------------------+
GetServiceDisplayNameW(context.Context, *GetServiceDisplayNameWRequest) (*GetServiceDisplayNameWResponse, error)
// The RGetServiceKeyNameW method returns the ServiceName of the service record with
// the specified DisplayName.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The name specified in the lpDisplayName parameter is invalid or set to NULL. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1060 ERROR_SERVICE_DOES_NOT_EXIST | The service record with the DisplayName matching the value specified in the |
// | | lpDisplayName parameter does not exist in the SCM database identified by the |
// | | hSCManager parameter. |
// +-----------------------------------+----------------------------------------------------------------------------------+
GetServiceKeyNameW(context.Context, *GetServiceKeyNameWRequest) (*GetServiceKeyNameWResponse, error)
// Opnum22NotUsedOnWire operation.
// Opnum22NotUsedOnWire
// The RChangeServiceConfigA method changes a service's configuration parameters in
// the SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_CHANGE_CONFIG access right had not been granted to the caller when |
// | | the RPC context handle to the service record was created. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1057 ERROR_INVALID_SERVICE_ACCOUNT | The user account name specified in the lpServiceStartName parameter does not |
// | | exist. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1059 ERROR_CIRCULAR_DEPENDENCY | A circular service dependency was specified. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1078 ERROR_DUPLICATE_SERVICE_NAME | The lpDisplayName matches either the ServiceName or the DisplayName of another |
// | | service record in the service control manager database. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The RDeleteService has been called for the service record identified by the |
// | | hService parameter. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +--------------------------------------+----------------------------------------------------------------------------------+
ChangeServiceConfigA(context.Context, *ChangeServiceConfigARequest) (*ChangeServiceConfigAResponse, error)
// The RCreateServiceA method creates the service record in the SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +--------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +--------------------------------------+----------------------------------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SC_MANAGER_CREATE_SERVICE access right had not been granted to the caller |
// | | when the RPC context handle was created. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 13 ERROR_INVALID_DATA | The data is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The specified service name is invalid. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1057 ERROR_INVALID_SERVICE_ACCOUNT | The user account name specified in the lpServiceStartName parameter does not |
// | | exist. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1059 ERROR_CIRCULAR_DEPENDENCY | A circular service dependency was specified. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The service record with a specified name already exists, and RDeleteService has |
// | | been called for it. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1073 ERROR_SERVICE_EXISTS | The service record with the ServiceName matching the specified lpServiceName |
// | | already exists. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1078 ERROR_DUPLICATE_SERVICE_NAME | The service record with the same DisplayName or the same ServiceName as the |
// | | passed-in lpDisplayName already exists in the service control manager database. |
// +--------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +--------------------------------------+----------------------------------------------------------------------------------+
CreateServiceA(context.Context, *CreateServiceARequest) (*CreateServiceAResponse, error)
// The REnumDependentServicesA method returns the ServiceName, DisplayName, and ServiceStatus
// of each service record that depends on the specified service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +---------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------+----------------------------------------------------------------------------------+
// +---------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_ENUMERATE_DEPENDENT access right had not been granted to the caller |
// | | when the RPC context handle to the service record was created. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 234 ERROR_MORE_DATA | More data is available. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +---------------------------------+----------------------------------------------------------------------------------+
EnumDependentServicesA(context.Context, *EnumDependentServicesARequest) (*EnumDependentServicesAResponse, error)
// The REnumServicesStatusA method enumerates service records in the specified SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +----------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +----------------------------+----------------------------------------------------------------------------------+
// +----------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SC_MANAGER_ENUMERATE_SERVICE access right had not been granted to the caller |
// | | when the RPC context handle to the service record was created. |
// +----------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +----------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +----------------------------+----------------------------------------------------------------------------------+
// | 234 ERROR_MORE_DATA | More data is available. |
// +----------------------------+----------------------------------------------------------------------------------+
EnumServicesStatusA(context.Context, *EnumServicesStatusARequest) (*EnumServicesStatusAResponse, error)
// The ROpenSCManagerA method opens a connection to the SCM from the client and then
// opens the specified SCM database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +------------------------------------+----------------------------------------------------------------------------------+
// +------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SC_MANAGER_CONNECT access right or the desired access is not granted to the |
// | | caller in the SCM SecurityDescriptor. |
// +------------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The specified service name is invalid. |
// +------------------------------------+----------------------------------------------------------------------------------+
// | 1065 ERROR_DATABASE_DOES_NOT_EXIST | The database specified does not exist. |
// +------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +------------------------------------+----------------------------------------------------------------------------------+
OpenSCMA(context.Context, *OpenSCMARequest) (*OpenSCMAResponse, error)
// The ROpenServiceA method creates an RPC context handle to an existing service record.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The access specified by the dwDesiredAccess parameter cannot be granted to the |
// | | caller. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The specified service name is invalid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1060 ERROR_SERVICE_DOES_NOT_EXIST | The service record with a specified DisplayName does not exist in the SCM |
// | | database. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +-----------------------------------+----------------------------------------------------------------------------------+
OpenServiceA(context.Context, *OpenServiceARequest) (*OpenServiceAResponse, error)
// The RQueryServiceConfigA method returns the configuration parameters of the specified
// service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +---------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------+----------------------------------------------------------------------------------+
// +---------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_QUERY_CONFIG access right had not been granted to the caller when |
// | | the RPC context handle was created. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 122 ERROR_INSUFFICIENT_BUFFER | The data area passed to a system call is too small. |
// +---------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +---------------------------------+----------------------------------------------------------------------------------+
QueryServiceConfigA(context.Context, *QueryServiceConfigARequest) (*QueryServiceConfigAResponse, error)
// The RQueryServiceLockStatusA method returns the lock status of the specified SCM
// database.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-------------------------------+----------------------------------------------------------------------------------+
// +-------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SC_MANAGER_QUERY_LOCK_STATUS access right had not been granted to the caller |
// | | when the RPC context handle was created. |
// +-------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +-------------------------------+----------------------------------------------------------------------------------+
// | 122 ERROR_INSUFFICIENT_BUFFER | The data area passed to a system call is too small. |
// +-------------------------------+----------------------------------------------------------------------------------+
QueryServiceLockStatusA(context.Context, *QueryServiceLockStatusARequest) (*QueryServiceLockStatusAResponse, error)
// The RStartServiceA method starts a specified service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.<46>
//
// +---------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------------+----------------------------------------------------------------------------------+
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 2 ERROR_FILE_NOT_FOUND | The system cannot find the file specified. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 3 ERROR_PATH_NOT_FOUND | The system cannot find the path specified. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_START access right had not been granted to the caller when the RPC |
// | | context handle to the service was created. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1053 ERROR_SERVICE_REQUEST_TIMEOUT | The process for the service was started, but it did not respond within an |
// | | implementation-specific time-out.<47> |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1054 ERROR_SERVICE_NO_THREAD | A thread could not be created for the service. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1055 ERROR_SERVICE_DATABASE_LOCKED | The service database is locked by the call to the RLockServiceDatabase (section |
// | | 3.1.4.4) method.<48> |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1056 ERROR_SERVICE_ALREADY_RUNNING | The ServiceStatus.dwCurrentState in the service record is not set to |
// | | SERVICE_STOPPED. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1058 ERROR_SERVICE_DISABLED | The service cannot be started because the Start field in the service record is |
// | | set to SERVICE_DISABLED. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1068 ERROR_SERVICE_DEPENDENCY_FAIL | The specified service depends on another service that has failed to start. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1069 ERROR_SERVICE_LOGON_FAILED | The service did not start due to a logon failure. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The RDeleteService method has been called for the service record identified by |
// | | the hService parameter. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1075 ERROR_SERVICE_DEPENDENCY_DELETED | The specified service depends on a service that does not exist or has been |
// | | marked for deletion. |
// +---------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +---------------------------------------+----------------------------------------------------------------------------------+
StartServiceA(context.Context, *StartServiceARequest) (*StartServiceAResponse, error)
// The RGetServiceDisplayNameA method returns the display name of the specified service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 122 ERROR_INSUFFICIENT_BUFFER | The display name does not fit in the buffer. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The specified service name is invalid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1060 ERROR_SERVICE_DOES_NOT_EXIST | The service record with the specified ServiceName does not exist in the SCM |
// | | database identified by the hSCManager parameter. |
// +-----------------------------------+----------------------------------------------------------------------------------+
GetServiceDisplayNameA(context.Context, *GetServiceDisplayNameARequest) (*GetServiceDisplayNameAResponse, error)
// The RGetServiceKeyNameA method returns the ServiceName of the service record with
// the specified DisplayName.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 122 ERROR_INSUFFICIENT_BUFFER | The data area passed to a system call is too small. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 123 ERROR_INVALID_NAME | The name specified in lpDisplayName is invalid or set to NULL. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1060 ERROR_SERVICE_DOES_NOT_EXIST | The service record with the DisplayName matching the specified lpDisplayName |
// | | does not exist in the SCM database identified by the hSCManager parameter. |
// +-----------------------------------+----------------------------------------------------------------------------------+
GetServiceKeyNameA(context.Context, *GetServiceKeyNameARequest) (*GetServiceKeyNameAResponse, error)
// Opnum34NotUsedOnWire operation.
// Opnum34NotUsedOnWire
// The REnumServiceGroupW method returns the members of a service group.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SC_MANAGER_ENUMERATE_SERVICE access right had not been granted to the caller |
// | | when the RPC context handle was created. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 234 ERROR_MORE_DATA | More data is available. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1060 ERROR_SERVICE_DOES_NOT_EXIST | The group specified by pszGroupName does not exist in the SCM GroupList. |
// +-----------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +-----------------------------------+----------------------------------------------------------------------------------+
EnumServiceGroupW(context.Context, *EnumServiceGroupWRequest) (*EnumServiceGroupWResponse, error)
// The RChangeServiceConfig2A method SHOULD<51> change the optional configuration parameters
// of a service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise
// it returns one of the following error codes.<52>
//
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_CHANGE_CONFIG access right had not been granted to the caller when |
// | | the RPC context handle to the service record was created. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The RDeleteService has been called for the service record identified by the |
// | | hService parameter. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 1080 ERROR_CANNOT_DETECT_DRIVER_FAILURE | SERVICE_CONFIG_FAILURE_ACTIONS cannot be used as a dwInfoLevel in the Info |
// | | parameter for service records with a Type value defined for drivers. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
ChangeServiceConfig2A(context.Context, *ChangeServiceConfig2ARequest) (*ChangeServiceConfig2AResponse, error)
// The RChangeServiceConfig2W <53> method changes the optional configuration parameters
// of a service.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise
// it returns one of the following error codes.<54>
//
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 5 ERROR_ACCESS_DENIED | The SERVICE_CHANGE_CONFIG access right had not been granted to the caller when |
// | | the RPC context handle to the service record was created. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 6 ERROR_INVALID_HANDLE | The handle is no longer valid. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 87 ERROR_INVALID_PARAMETER | A parameter that was specified is invalid. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 1072 ERROR_SERVICE_MARKED_FOR_DELETE | The RDeleteService has been called for the service record identified by the |
// | | hService parameter. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 1080 ERROR_CANNOT_DETECT_DRIVER_FAILURE | SERVICE_CONFIG_FAILURE_ACTIONS cannot be used as a dwInfoLevel in the Info |
// | | parameter for service records with a Type value defined for drivers. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
// | 1115 ERROR_SHUTDOWN_IN_PROGRESS | The system is shutting down. |
// +-----------------------------------------+----------------------------------------------------------------------------------+
ChangeServiceConfig2W(context.Context, *ChangeServiceConfig2WRequest) (*ChangeServiceConfig2WResponse, error)
// The RQueryServiceConfig2A <55> method returns the optional configuration parameters
// of the specified service based on the specified information level.
//
// Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise,
// it returns one of the following error codes.
//
// +---------------------------------+----------------------------------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +---------------------------------+----------------------------------------------------------------------------------+