Méthode | Description | |
---|---|---|
CreateService ( string lpBinaryPathName, string lpServiceName, string lpDisplayName, string lpDescription, string lpServiceStartName, string lpPassword ) : void |
Creates a service object and adds it to service control manager database o the local computer.
|
|
CryptGetProvParam ( |
Retrieves parameters that govern the operations of a cryptographic service provider (CSP).
|
|
DeleteService ( string lpServiceName ) : void |
Marks the specified service for deletion from the service control manager database on the local computer.
|
|
EnumServicesStatus ( ) : IEnumerable |
Enumerates services in the specified service control manager database. The name and status of each service are provided.
|
|
GetTokenElevationType ( SafeObjectHandle TokenHandle ) : TOKEN_ELEVATION_TYPE |
Get the elevation type of a token via GetTokenInformation(SafeObjectHandle, TOKEN_INFORMATION_CLASS, void*, int, out int).
|
|
QueryServiceObjectSecurity ( SafeServiceHandle hService, SECURITY_INFORMATION dwSecurityInformation ) : RawSecurityDescriptor |
Retrieves a copy of the security descriptor associated with a service object. You can also use the GetNamedSecurityInfo function to retrieve a security descriptor.
|
|
SetServiceObjectSecurity ( SafeServiceHandle hService, SECURITY_INFORMATION dwSecurityInformation, RawSecurityDescriptor lpSecurityDescriptor ) : void |
The SetServiceObjectSecurity function sets the security descriptor of a service object.
|
Méthode | Description | |
---|---|---|
ChangeServiceConfig ( SafeServiceHandle hService, ServiceType dwServiceType, ServiceStartType dwStartType, ServiceErrorControl dwErrorControl, string lpBinaryPathName, string lpLoadOrderGroup, int lpdwTagId, string lpDependencies, string lpServiceStartName, string lpPassword, string lpDisplayName ) : bool | ||
ChangeServiceConfig2 ( SafeServiceHandle hService, ServiceInfoLevel dwInfoLevel, void lpInfo ) : bool | ||
CloseServiceHandle ( |
||
ControlService ( SafeServiceHandle hService, ServiceControl dwControl, SERVICE_STATUS &lpServiceStatus ) : bool | ||
ConvertSidToStringSid ( |
||
ConvertStringSidToSid ( string StringSid, void &sid ) : bool | ||
CreateService ( SafeServiceHandle hSCManager, string lpServiceName, string lpDisplayName, ACCESS_MASK dwDesiredAccess, ServiceType dwServiceType, ServiceStartType dwStartType, ServiceErrorControl dwErrorControl, string lpBinaryPathName, string lpLoadOrderGroup, int lpdwTagId, string lpDependencies, string lpServiceStartName, string lpPassword ) : SafeServiceHandle | ||
CryptGetProvParam ( |
||
CryptReleaseContext ( |
||
CryptSetProvParam ( |
||
DeleteService ( SafeServiceHandle hService ) : bool | ||
DuplicateTokenEx ( SafeObjectHandle hExistingToken, ACCESS_MASK dwDesiredAccess, [ lpTokenAttributes, SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, TOKEN_TYPE TokenType, SafeObjectHandle &phNewToken ) : bool | ||
EnumServicesStatus ( SafeServiceHandle hSCManager, ServiceType dwServiceType, ServiceStateQuery dwServiceState, byte lpServices, int cbBufSize, int &pcbBytesNeeded, int &lpServicesReturned, int &lpResumeHandle ) : bool | ||
GetNamedSecurityInfo ( string pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, void &ppsidOwner, void &ppsidGroup, [ ppDacl, [ ppSacl, [ ppSecurityDescriptor ) : Win32ErrorCode | ||
GetSecurityInfo ( |
||
GetTokenInformation ( SafeObjectHandle TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, void TokenInformation, int TokenInformationLength, int &ReturnLength ) : bool | ||
LsaNtStatusToWinError ( NTSTATUS Status ) : Win32ErrorCode | ||
OpenProcessToken ( |
||
OpenSCManager ( string lpMachineName, string lpDatabaseName, ACCESS_MASK dwDesiredAccess ) : SafeServiceHandle | ||
OpenService ( SafeServiceHandle hSCManager, string lpServiceName, ACCESS_MASK dwDesiredAccess ) : SafeServiceHandle | ||
QueryServiceObjectSecurity ( SafeServiceHandle hService, SECURITY_INFORMATION dwSecurityInformation, byte lpSecurityDescriptor, int cbBufSize, int &pcbBytesNeeded ) : bool | ||
QueryServiceStatus ( SafeServiceHandle hService, SERVICE_STATUS &dwServiceStatus ) : bool | ||
QueryServiceStatusEx ( SafeServiceHandle hService, SC_STATUS_TYPE InfoLevel, void lpBuffer, int cbBufSize, int &pcbBytesNeeded ) : bool | ||
RegFlushKey ( SafeRegistryHandle hKey ) : Win32ErrorCode | ||
RegNotifyChangeKeyValue ( SafeRegistryHandle hKey, bool bWatchSubtree, RegNotifyFilter dwNotifyFilter, SafeWaitHandle hEvent, bool fAsynchronous ) : Win32ErrorCode | ||
RegOpenKeyEx ( SafeRegistryHandle hKey, string lpSubKey, RegOpenKeyOptions ulOptions, ACCESS_MASK samDesired, SafeRegistryHandle &phkResult ) : Win32ErrorCode | ||
RegisterServiceCtrlHandler ( string lpServiceName, LPHANDLER_FUNCTION lpHandlerProc ) : |
||
RegisterServiceCtrlHandlerEx ( string lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, void lpContext ) : |
||
SetNamedSecurityInfo ( string pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, void psidOwner, void psidGroup, [ pDacl, [ pSacl ) : uint | ||
SetSecurityInfo ( |
||
SetServiceObjectSecurity ( SafeServiceHandle hService, SECURITY_INFORMATION dwSecurityInformation, byte lpSecurityDescriptor ) : bool | ||
SetServiceStatus ( IntPtr hServiceStatus, SERVICE_STATUS &lpServiceStatus ) : bool | ||
StartService ( SafeServiceHandle hService, int dwNumServiceArgs, string lpServiceArgVectors ) : bool |
public static CreateService ( string lpBinaryPathName, string lpServiceName, string lpDisplayName, string lpDescription, string lpServiceStartName, string lpPassword ) : void | ||
lpBinaryPathName | string | /// The fully qualified path to the service binary file. If the path contains a space, it must be quoted so that it is correctly interpreted. /// For example, "d:\\my share\\myservice.exe" should be specified as "\"d:\\my share\\myservice.exe\"". /// The path can also include arguments for an auto-start service. /// For example, "d:\\myshare\\myservice.exe arg1 arg2". /// These arguments are passed to the service entry point (typically the main function). /// |
lpServiceName | string | /// The name of the service to install. The maximum string length is 256 characters. /// The service control manager database preserves the case of the characters, but service name comparisons are always case insensitive. /// Forward-slash (/) and backslash (\) are not valid service name characters. /// |
lpDisplayName | string | /// The display name to be used by user interface programs to identify the service. /// This string has a maximum length of 256 characters. The name is case-preserved in the service control manager. /// Display name comparisons are always case-insensitive. /// |
lpDescription | string | /// The description of the service. If this member is NULL, the description remains unchanged. /// If this value is an empty string (""), the current description is deleted. /// The service description must not exceed the size of a registry value of type REG_SZ. /// |
lpServiceStartName | string | /// The name of the account under which the service should run. /// Use an account name in the form DomainName\UserName. The service process will be logged on as this user. /// If the account belongs to the built-in domain, you can specify .\UserName. /// |
lpPassword | string |
/// The password to the account name specified by the lpServiceStartName parameter.
/// Specify an empty string if the account has no password or if the service runs in the LocalService, NetworkService, or LocalSystem account.
/// If the account name specified by the |
Résultat | void |
public static CryptGetProvParam ( |
||
hProv | A handle of the CSP target of the query. This handle must have been created by using the CryptAcquireContext function. | |
dwParam | CryptGetProvParamQuery | The nature of the query. |
dwFlags | uint |
/// If |
Résultat | byte[] |
public static DeleteService ( string lpServiceName ) : void | ||
lpServiceName | string |
/// The name of the service to be opened. This is the name specified by the lpServiceName parameter of the |
Résultat | void |
public static EnumServicesStatus ( ) : IEnumerable |
||
Résultat | IEnumerable |
public static GetTokenElevationType ( SafeObjectHandle TokenHandle ) : TOKEN_ELEVATION_TYPE | ||
TokenHandle | SafeObjectHandle | /// A handle to an access token from which information is retrieved. The handle must have /// TOKEN_QUERY access. /// |
Résultat | TOKEN_ELEVATION_TYPE |
public static QueryServiceObjectSecurity ( SafeServiceHandle hService, SECURITY_INFORMATION dwSecurityInformation ) : RawSecurityDescriptor | ||
hService | SafeServiceHandle |
/// A handle to the service control manager or the service. Handles to the service control manager
/// are returned by the |
dwSecurityInformation | SECURITY_INFORMATION |
/// A set of bit flags that indicate the type of security information to retrieve. This
/// parameter can be a combination of the |
Résultat | RawSecurityDescriptor |
public static SetServiceObjectSecurity ( SafeServiceHandle hService, SECURITY_INFORMATION dwSecurityInformation, RawSecurityDescriptor lpSecurityDescriptor ) : void | ||
hService | SafeServiceHandle |
/// A handle to the service. This handle is returned by the |
dwSecurityInformation | SECURITY_INFORMATION |
/// Specifies the components of the security descriptor to set. This parameter can be a
/// combination of the following values : |
lpSecurityDescriptor | RawSecurityDescriptor | The new security information. |
Résultat | void |