Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "Service" in [All]

icmp

.

    using System.Runtime.InteropServices;

comctl32

.

using System.Runtime.InteropServices;

.

using System.Runtime.InteropServices;

.

using Microsoft.SDK.Samples.VistaBridge.Interop or .Library or .Properties or .Services - Depending on your needs.

.

using Microsoft.SDK.Samples.VistaBridge.Interop or .Library or .Properties or .Services - Depending on your needs.

crypt32

.

In the Web Services Development Kit (WSDK) Technology Preview and .NET Whidbey.

.

    using System.Runtime.InteropServices;

.

CharSet=System.Runtime.InteropServices.CharSet.Auto)

.

<DllImport("Crypt32.dll", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _

.

Under some circumstances, Microsoft cryptographic service providers (CSPs) may not allow encryption when used in France, in which case this function fails with the error code NTE_PERM.

.

CharSet=System.Runtime.InteropServices.CharSet.Auto)

.

<DllImport("Crypt32.dll", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _

Structures

.

using System.Runtime.InteropServices;

.

Imports System.Runtime.InteropServices

.

Imports System.Runtime.InteropServices

.

    int dwServiceMask;

.

    Dim dwServiceMask As Integer

.
Summary
The CRYPT_KEY_PROV_INFO structure contains information about a key container within a cryptographic service provider (CSP).
.

   <System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)> _

15: DCB
.

using System.Runtime.InteropServices;

.

    [System.Runtime.InteropServices.FieldOffset(0)]

.

    [System.Runtime.InteropServices.FieldOffset(32)]

.

    [System.Runtime.InteropServices.FieldOffset(34)]

.

    [System.Runtime.InteropServices.FieldOffset(36)]

.

    [System.Runtime.InteropServices.FieldOffset(38)]

.

    [System.Runtime.InteropServices.FieldOffset(40)]

.

    [System.Runtime.InteropServices.FieldOffset(44)]

.

    [System.Runtime.InteropServices.FieldOffset(46)]

.

    [System.Runtime.InteropServices.FieldOffset(48)]

.

    [System.Runtime.InteropServices.FieldOffset(50)]

.

    [System.Runtime.InteropServices.FieldOffset(52)]

.

    [System.Runtime.InteropServices.FieldOffset(54)]

.

    [System.Runtime.InteropServices.FieldOffset(56)]

.

    [System.Runtime.InteropServices.FieldOffset(58)]

.

    [System.Runtime.InteropServices.FieldOffset(44)]

.

    [System.Runtime.InteropServices.FieldOffset(52)]

.

    [System.Runtime.InteropServices.FieldOffset(56)]

.

    [System.Runtime.InteropServices.FieldOffset(60)]

.

    [System.Runtime.InteropServices.FieldOffset(62)]

.

    [System.Runtime.InteropServices.FieldOffset(64)]

.

    [System.Runtime.InteropServices.FieldOffset(66)]

.

    [System.Runtime.InteropServices.FieldOffset(68)]

.

    [System.Runtime.InteropServices.FieldOffset(70)]

.

    [System.Runtime.InteropServices.FieldOffset(102)]

.

    [System.Runtime.InteropServices.FieldOffset(104)]

.

    [System.Runtime.InteropServices.FieldOffset(108)]

.

    [System.Runtime.InteropServices.FieldOffset(112)]

.

    [System.Runtime.InteropServices.FieldOffset(116)]

.

    [System.Runtime.InteropServices.FieldOffset(116)]

.

    [System.Runtime.InteropServices.FieldOffset(120)]

.

using System.Runtime.InteropServices;

.

Imports System.Runtime.InteropServices

.

<System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)> _

.
Summary
The ENUM_SERVICE_STATUS structure is used by the EnumDependentServices and EnumServicesStatus functions to return the name of a service in a service control manager database and to return information about that service.
.

public struct ENUM_SERVICE_STATUS

.

     [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

     public string pServiceName;

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

     public SERVICE_STATUS ServiceStatus;

.

Structure ENUM_SERVICE_STATUS

.
Documentation
[ENUM_SERVICE_STATUS] on MSDN
.

       public System.Runtime.InteropServices.ComTypes.FILETIME ftCreationTime;

.

       public System.Runtime.InteropServices.ComTypes.FILETIME ftLastAccessTime;

.

       public System.Runtime.InteropServices.ComTypes.FILETIME ftLastWriteTime;

.

<Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet:=Runtime.InteropServices.CharSet.Auto)>

.

    Public ftCreationTime As System.Runtime.InteropServices.ComTypes.FILETIME

.

    Public ftLastAccessTime As System.Runtime.InteropServices.ComTypes.FILETIME

.

    Public ftLastWriteTime As System.Runtime.InteropServices.ComTypes.FILETIME

.

    <Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=260)>

.

[System.Runtime.InteropServices.FILETIME] (obsolete), or [System.Runtime.InteropServices.ComTypes.FILETIME] in the .NET Framework 2.0.

.

There is no reason not to use [System.Runtime.InteropServices.ComTypes.FILETIME], but there still is a need for conversion to [DateTime]:

.

* Note that System.Runtime.InteropServices.FILETIME is now obsolete. Changed to use System.Runtime.InteropServices.ComTypes.FILETIME instead.

.

    //     handle with the GMEM_SHARE flag. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     The storage medium is a disk file identified by a path. If the STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     ISequentialStream::Read to read the data. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     to access the metafile's data. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     The storage medium is an enhanced metafile. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     handle with the GMEM_SHARE flag. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     The storage medium is a disk file identified by a path. If the STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     ISequentialStream::Read to read the data. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     to access the metafile's data. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     The storage medium is an enhanced metafile. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.
Summary
The HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM structure is used to specify an IP address to be added to or deleted from the list of IP addresses to which the HTTP service binds.
.

public struct HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM

.

Structure HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM

.
Documentation
[HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM] on MSDN
.
Summary
The HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY structure is used by HttpQueryServiceConfiguration to return a list of the Internet Protocol (IP) addresses to which the HTTP service binds.
.

struct HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY

.

Structure HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY

.
Documentation
[HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY] on MSDN
.
Summary
.

public struct HTTP_SERVICE_CONFIG_SSL_KEY

.

Structure HTTP_SERVICE_CONFIG_SSL_KEY

.
Documentation
[HTTP_SERVICE_CONFIG_SSL_KEY] on MSDN
.
Summary
.

struct HTTP_SERVICE_CONFIG_SSL_PARAM

.

Structure HTTP_SERVICE_CONFIG_SSL_PARAM

.
Documentation
[HTTP_SERVICE_CONFIG_SSL_PARAM] on MSDN
.
Summary
.

public struct HTTP_SERVICE_CONFIG_SSL_QUERY

.

     public HTTP_SERVICE_CONFIG_QUERY_TYPE QueryDesc;

.

     public HTTP_SERVICE_CONFIG_SSL_KEY KeyDesc;

.

Structure HTTP_SERVICE_CONFIG_SSL_QUERY

.

HTTP_SERVICE_CONFIG_QUERY_TYPE

.

HTTP_SERVICE_CONFIG_SSL_KEY

.
Documentation
[HTTP_SERVICE_CONFIG_SSL_QUERY] on MSDN
.
Summary
The HTTP_SERVICE_CONFIG_SSL_SET structure is used to add a new record to the SSL store or retrieve an existing record from it. An instance of the structure is used to pass data in to the HttpSetServiceConfiguration function through the pConfigInformation parameter or to retrieve data from the HttpQueryServiceConfiguration function through the pOutputConfigInformation parameter when the ConfigId parameter of either function is equal to HttpServiceConfigSSLCertInfo.
.

struct HTTP_SERVICE_CONFIG_SSL_SET

.

     public HTTP_SERVICE_CONFIG_SSL_KEY KeyDesc;

.

     public HTTP_SERVICE_CONFIG_SSL_PARAM ParamDesc;

.

Structure HTTP_SERVICE_CONFIG_SSL_SET

.

HTTP_SERVICE_CONFIG_SSL_KEY

.

HTTP_SERVICE_CONFIG_SSL_PARAM

.
Documentation
[HTTP_SERVICE_CONFIG_SSL_SET] on MSDN
.
Summary
The HTTP_SERVICE_CONFIG_URLACL_KEY structure is used to specify a particular reservation record in the URL namespace reservation store. It is a member of the HTTP_SERVICE_CONFIG_URLACL_SET and HTTP_SERVICE_CONFIG_URLACL_QUERY structures.
.

public struct HTTP_SERVICE_CONFIG_URLACL_KEY

.

     public HTTP_SERVICE_CONFIG_URLACL_KEY(string urlPrefix)

.

Public Structure HTTP_SERVICE_CONFIG_URLACL_KEY

.
Documentation
[HTTP_SERVICE_CONFIG_URLACL_KEY] on MSDN
.
Summary
The HTTP_SERVICE_CONFIG_URLACL_PARAM structure is used to specify the permissions associated with a particular record in the URL namespace reservation store. It is a member of the HTTP_SERVICE_CONFIG_URLACL_SET structure.
.

struct HTTP_SERVICE_CONFIG_URLACL_PARAM

.

     public HTTP_SERVICE_CONFIG_URLACL_PARAM(string securityDescriptor)

.

Public Structure HTTP_SERVICE_CONFIG_URLACL_PARAM

.
Documentation
[HTTP_SERVICE_CONFIG_URLACL_PARAM] on MSDN
.
Summary
.

struct HTTP_SERVICE_CONFIG_URLACL_QUERY

.

     public HTTP_SERVICE_CONFIG_QUERY_TYPE QueryDesc;

.

     public HTTP_SERVICE_CONFIG_URLACL_KEY KeyDesc;

.

Structure HTTP_SERVICE_CONFIG_URLACL_QUERY

.

HTTP_SERVICE_CONFIG_QUERY_TYPE

.

HTTP_SERVICE_CONFIG_URLACL_KEY

.
Documentation
[HTTP_SERVICE_CONFIG_URLACL_QUERY] on MSDN
.
Summary
.

struct HTTP_SERVICE_CONFIG_URLACL_SET

.

     public HTTP_SERVICE_CONFIG_URLACL_KEY KeyDesc;

.

     public HTTP_SERVICE_CONFIG_URLACL_PARAM ParamDesc;

.

Public Structure HTTP_SERVICE_CONFIG_URLACL_SET

.

    Public KeyDesc As HTTP_SERVICE_CONFIG_URLACL_KEY

.

    Public ParamDesc As HTTP_SERVICE_CONFIG_URLACL_PARAM

.

HTTP_SERVICE_CONFIG_URLACL_KEY

.

HTTP_SERVICE_CONFIG_URLACL_PARAM

.
Documentation
[HTTP_SERVICE_CONFIG_URLACL_SET] on MSDN
.

        IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11,

.

    '''                        //  Terminal- Services-aware, it

.

    '   that is not Terminal- Services-aware, it also loads a DLL that contains compatibility code)

.

    '   that is not Terminal- Services-aware, it also loads a DLL that contains compatibility code)

.

        IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11,

.

  public byte TypeOfService;

.

   public IntPtr SecurityQualityOfService;

.

   Dim SecurityQualityOfService As IntPtr

.

'Service provided by Telerik (www.telerik.com)

37: MAPI
.

    /// Pointer to an opaque entry identifier used by a messaging system service provider to identify the

.

    /// message recipient. Entry identifiers have meaning only for the service provider;

.

    ''' Pointer to an opaque entry identifier used by a messaging system service provider to identify the

.

    ''' message recipient. Entry identifiers have meaning only for the service provider;

.

mi.cbSize = System.Runtime.InteropServices­.Marshal.SizeOf(typeof(MENUINF­O));

.

using System.Runtime.InteropServices

.

    Public SecurityQualityOfService As IntPtr

.

        SecurityQualityOfService = IntPtr.Zero

.

   public IntPtr SecurityQualityOfService;

.

     SecurityQualityOfService = IntPtr.Zero;

.
Summary
The OSVERSIONINFOEX structure contains operating system version information. The information includes major and minor version numbers, a build number, a platform identifier, and information about product suites and the latest Service Pack installed on the system.
.

   public UInt16 wServicePackMajor;  

.

   public UInt16 wServicePackMinor;  

.

    public ushort wServicePackMajor;

.

    public ushort wServicePackMinor;

.

   Public wServicePackMajor As UInt16

.

   Public wServicePackMinor As UInt16

.
Summary
The OSVERSIONINFOEX structure contains operating system version information. The information includes major and minor version numbers, a build number, a platform identifier, and information about product suites and the latest Service Pack installed on the system.
.

   public UInt16 wServicePackMajor;  

.

   public UInt16 wServicePackMinor;  

.

   Public wServicePackMajor As UInt16

.

   Public wServicePackMinor As UInt16

.

[System.Runtime.InteropServices.ComVisible(false)]        

.
Summary
.

    <System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)> _

46: RECT
.

Imports System.Runtime.InteropServices

.

using System.Runtime.InteropServices;

.

using System.Runtime.InteropServices;

.
Summary
Represents information about entries from the service database.
.

        public struct SERVICE_FAILURE_ACTIONS

.

Structure SERVICE_FAILURE_ACTIONS

.
Documentation
[SERVICE_FAILURE_ACTIONS] on MSDN
.
Summary
The SERVICE_STATUS structure contains information about a service. The ControlService, EnumDependentServices, EnumServicesStatus, and QueryServiceStatus functions use this structure to return information about a service. A service uses this structure in the SetServiceStatus function to report its current status to the service control manager.
.

public struct SERVICE_STATUS

.

     public SERVICE_TYPES dwServiceType;

.

     public SERVICE_STATE dwCurrentState;  

.

     public uint dwServiceSpecificExitCode;  

.

Easier Structure (which appears to work fine and allows you to avoid defining the SERVICE_TYPES and SERVICE_STATE enumerations and to use CLR compliant types (int)):

.

    private struct SERVICE_STATUS

.

        public int serviceType;

.

        public int serviceSpecificExitCode;

.
See
.

Estimated time required for a pending start, stop, pause, or continue operation, in milliseconds. Before the specified amount of time has elapsed, the service should make its next call to the SetServiceStatus function with either an incremented dwCheckPoint value or a change in dwCurrentState. If the amount of time specified by dwWaitHint passes, and dwCheckPoint has not been incremented or dwCurrentState has not changed, the service control manager or service control program can assume that an error has occurred and the service should be stopped. However, if the service shares a process with other services, the service control manager cannot terminate the service application because it would have to terminate the other services sharing the process as well.

.

Private Structure SERVICE_STATUS

.

    Dim dwServiceType As Int32

.

    Dim dwServiceSpecificExitCode As Int32

.

Utility class to manage SetServiceStatus()

.

    internal class ServiceStateSignalizer

.

    internal enum SERVICE_STATE : int

.

        SERVICE_STOPPED = 0x00000001,

.

        SERVICE_START_PENDING = 0x00000002,

.

        SERVICE_STOP_PENDING = 0x00000003,

.

        SERVICE_RUNNING = 0x00000004,

.

        SERVICE_CONTINUE_PENDING = 0x00000005,

.

        SERVICE_PAUSE_PENDING = 0x00000006,

.

        SERVICE_PAUSED = 0x00000007,

.

    internal enum SERVICE_TYPE : int

.

        SERVICE_KERNEL_DRIVER = 0x00000001,

.

        SERVICE_FILE_SYSTEM_DRIVER = 0x00000002,

.

        SERVICE_WIN32_OWN_PROCESS = 0x00000010,

.

        SERVICE_WIN32_SHARE_PROCESS = 0x00000020,

.

        SERVICE_INTERACTIVE_PROCESS = 0x00000100

.

        SERVICE_ACCEPT_NETBINDCHANGE = 0x00000010,

.

        SERVICE_ACCEPT_PARAMCHANGE = 0x00000008,

.

        SERVICE_ACCEPT_PAUSE_CONTINUE = 0x00000002,

.

        SERVICE_ACCEPT_PRESHUTDOWN = 0x00000100,

.

        SERVICE_ACCEPT_SHUTDOWN = 0x00000004,

.

        SERVICE_ACCEPT_STOP = 0x00000001,

.

        SERVICE_ACCEPT_HARDWAREPROFILECHANGE = 0x00000020,

.

        SERVICE_ACCEPT_POWEREVENT = 0x00000040,

.

        SERVICE_ACCEPT_SESSIONCHANGE = 0x00000080,

.

        SERVICE_ACCEPT_TIMECHANGE = 0x00000200,

.

        SERVICE_ACCEPT_TRIGGEREVENT = 0x00000400,

.

        SERVICE_ACCEPT_USERMODEREBOOT = 0x00000800

.

    internal struct ServiceStatus

.

        public SERVICE_TYPE dwServiceType;

.

        public SERVICE_STATE dwCurrentState;

.

        public long dwServiceSpecificExitCode;

.

    internal static extern bool SetServiceStatus(IntPtr handle, ref ServiceStatus serviceStatus);

.

See EnumServicesStatus and EnumDependentServices.

.

See ControlService for SERVICE_STATE definition.

.

See SERVICE_TYPES definition.

.
Documentation
[SERVICE_STATUS] on MSDN
.
Summary
This API allows you top set the status on a Windows Service. This is especially helpful in .NET in the various events you override from the ServiceBase class. For example, in the OnStart event, here is a recommendatation (see below for a custom enumeration with the SERVICE_START_PENDING and other states):
.

        myServiceStatus.currentState = (int)State.SERVICE_START_PENDING;

.

        myServiceStatus.checkPoint = 1;

.

        myServiceStatus.waitHint = 5000;

.

        SetServiceStatus(handle, ref myServiceStatus)

.

After your worker thread(s) start and are your service is running, call (before OnStart ends):

.

        myServiceStatus.currentState = (int)State.SERVICE_RUNNING;

.

        myServiceStatus.checkPoint = 0;

.

        myServiceStatus.waitHint = 0;

.

        SetServiceStatus(handle, ref myServiceStatus);

.

For more on writing services in .NET please search Google on: 'SetServiceStatus' and 'ServiceBase'

.

   private static extern bool SetServiceStatus(IntPtr hServiceStatus, ref SERVICE_STATUS lpServiceStatus);

.

Declare Function SetServiceStatus Lib "advapi32.dll" (

.

    ByVal hServiceStatus As IntPtr,

.

    ByRef lpServiceStatus As SERVICE_STATUS)

.

    SERVICE_STOPPED = 0x00000001,

.

    SERVICE_START_PENDING = 0x00000002,

.

    SERVICE_STOP_PENDING = 0x00000003,

.

    SERVICE_RUNNING = 0x00000004,

.

    SERVICE_CONTINUE_PENDING = 0x00000005,

.

    SERVICE_PAUSE_PENDING = 0x00000006,

.

    SERVICE_PAUSED = 0x00000007,

.

   public struct SERVICE_STATUS {

.

       public long serviceType;

.

       public long serviceSpecificExitCode;

.

1) The Microsoft MSDN Site is incorrect in their example for C#! They do not call the lpServiceStatus argument using the ref modifier.

.
Documentation
[SetServiceStatus] on MSDN
.

using System.Runtime.InteropServices;

.
Summary
Identifies an authentication service that a server is willing to use to communicate to a client.
.

struct SOLE_AUTHENTICATION_SERVICE

.

Structure SOLE_AUTHENTICATION_SERVICE

.
Documentation
[SOLE_AUTHENTICATION_SERVICE] on MSDN
.

    public System.Runtime.InteropServices.ComTypes.FILETIME DriverDate;

.

    public System.Runtime.InteropServices.ComTypes.FILETIME DriverDate;

.

using System.Runtime.InteropServices; // for CharSet

.

<System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)> _

.

[System.Runtime.InteropServices.DllImport("Kernel32.dll", SetLastError = true)]

.

[System.Runtime.InteropServices.DllImport("Kernel32.dll", SetLastError = true)]

.

[System.Runtime.InteropServices.DllImport("Kernel32.dll", SetLastError = true)]

.

    pti.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(pti);

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: