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 "RESOURCE" in [All]

mpr

.
Summary
The MultinetGetConnectionPerformance function returns information about the expected performance of a connection used to access a network resource.
.

        NetResource lpNetResource,

.

        /// the current connection with the resource, with any routing

.

    private class NETRESOURCE

.

        public ResourceScope dwScope = 0;

.

        public ResourceType dwType = 0;

.

        public ResourceDisplayType dwDisplayType = 0;

.

        public ResourceUsage dwUsage = 0;

.

    public enum ResourceScope

.

        RESOURCE_CONNECTED = 1,

.

        RESOURCE_GLOBALNET,

.

        RESOURCE_REMEMBERED,

.

        RESOURCE_RECENT,

.

        RESOURCE_CONTEXT

.

    public enum ResourceType

.

        RESOURCETYPE_ANY,

.

        RESOURCETYPE_DISK,

.

        RESOURCETYPE_PRINT,

.

        RESOURCETYPE_RESERVED

.

    public enum ResourceUsage

.

        RESOURCEUSAGE_CONNECTABLE = 0x00000001,

.

        RESOURCEUSAGE_CONTAINER = 0x00000002,

.

        RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004,

.

        RESOURCEUSAGE_SIBLING = 0x00000008,

.

        RESOURCEUSAGE_ATTACHED = 0x00000010,

.

        RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),

.

    public enum ResourceDisplayType

.

        RESOURCEDISPLAYTYPE_GENERIC,

.

        RESOURCEDISPLAYTYPE_DOMAIN,

.

        RESOURCEDISPLAYTYPE_SERVER,

.

        RESOURCEDISPLAYTYPE_SHARE,

.

        RESOURCEDISPLAYTYPE_FILE,

.

        RESOURCEDISPLAYTYPE_GROUP,

.

        RESOURCEDISPLAYTYPE_NETWORK,

.

        RESOURCEDISPLAYTYPE_ROOT,

.

        RESOURCEDISPLAYTYPE_SHAREADMIN,

.

        RESOURCEDISPLAYTYPE_DIRECTORY,

.

        RESOURCEDISPLAYTYPE_TREE,

.

        RESOURCEDISPLAYTYPE_NDSCONTAINER

.

    public enum ResourceConnection

.

private static extern int WNetAddConnection2( NETRESOURCE lpNetResource,

.

NETRESOURCE nr = new NETRESOURCE();

.

nr.dwType = ResourceType.RESOURCETYPE_DISK;

.

nr.dwDisplayType = ResourceDisplayType.RESOURCEDISPLAYTYPE_SHARE;

.

nr.dwScope = ResourceScope.RESOURCE_GLOBALNET;

.

nr.dwUsage = ResourceUsage.RESOURCEUSAGE_CONNECTABLE;

.

int result = WNetAddConnection2(nr, password, user, (int)ResourceConnection.CONNECT_TEMPORARY);

.

/* Uses Struct rather than class version of NETRESOURCE */

.

    ref NETRESOURCE lpNetResource, string lpPassword,

.

    ''' Use to pass handle to Provider of Network Resource

.

    ''' <param name="lpNetResource"></param>

.

                           ByVal lpNetResource As NETRESOURCE, _

.

NETRESOURCE

.

private const int RESOURCETYPE_ANY = 0x0;

.

NETRESOURCE ConnInf = new NETRESOURCE();

.

ConnInf.dwType = RESOURCETYPE_ANY;

.
Summary
The WNetAddConnection2 function makes a connection to a network resource. The function can redirect a local device to the network resource.
.

The WNetAddConnection2 function supersedes the WNetAddConnection function. If you can pass a handle to a window that the provider of network resources can use as an owner window for dialog boxes, call the WNetAddConnection3 function instead.

.

// This must be used if NETRESOURCE is defined as a struct

.

public static extern int WNetAddConnection2(ref NETRESOURCE netResource,

.

// This must be used if NETRESOURCE is defined as a class

.

public static extern int WNetAddConnection2(NETRESOURCE netResource,

.

// my NETRESOURCE is defined as:

.

//    class NETRESOURCE

.

  //      public enum ResourceScope

.

  //      RESOURCE_CONNECTED = 1,

.

  //      RESOURCE_GLOBALNET,

.

  //      RESOURCE_REMEMBERED,

.

  //      RESOURCE_RECENT,

.

  //      RESOURCE_CONTEXT

.

  //      public enum ResourceType

.

  //      RESOURCETYPE_ANY    = 0,

.

  //      RESOURCETYPE_DISK       = 1,

.

  //      RESOURCETYPE_PRINT      = 2,

.

  //      RESOURCETYPE_RESERVED   = 8,

.

  //      RESOURCETYPE_UNKNOWN    = -1,

.

  //      public enum ResourceUsage

.

  //      RESOURCEUSAGE_CONNECTABLE = 0x00000001,

.

  //      RESOURCEUSAGE_CONTAINER = 0x00000002,

.

  //      RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004,

.

  //      RESOURCEUSAGE_SIBLING = 0x00000008,

.

  //      RESOURCEUSAGE_ATTACHED = 0x00000010,

.

  //      RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),

.

  //      public enum ResourceDisplayType

.

  //      RESOURCEDISPLAYTYPE_GENERIC,

.

  //      RESOURCEDISPLAYTYPE_DOMAIN,

.

  //      RESOURCEDISPLAYTYPE_SERVER,

.

  //      RESOURCEDISPLAYTYPE_SHARE,

.

  //      RESOURCEDISPLAYTYPE_FILE,

.

  //      RESOURCEDISPLAYTYPE_GROUP,

.

  //      RESOURCEDISPLAYTYPE_NETWORK,

.

  //      RESOURCEDISPLAYTYPE_ROOT,

.

  //      RESOURCEDISPLAYTYPE_SHAREADMIN,

.

  //      RESOURCEDISPLAYTYPE_DIRECTORY,

.

  //      RESOURCEDISPLAYTYPE_TREE,

.

  //      RESOURCEDISPLAYTYPE_NDSCONTAINER

.

  //      private class NETRESOURCE

.

  //      public ResourceScope dwScope = 0;

.

  //      public ResourceType dwType = 0;

.

  //      public ResourceDisplayType dwDisplayType = 0;

.

  //      public ResourceUsage dwUsage = 0;

.

  //      private static extern ErrorCodes WNetAddConnection2(NETRESOURCE lpNetResource,ref string lpPassword,ref

.

public static extern int WNetAddConnection2( [In] NETRESOURCE netResource,

.

' This must be used if NETRESOURCE is defined as a struct

.

Declare Function WNetAddConnection2 Lib "mpr.dll" (ByRef netResource As _

.

   NETRESOURCE, password As String, Username As String, Flag As Integer) As Integer

.

' This must be used if NETRESOURCE is defined as a class

.

Declare Function WNetAddConnection2 Lib "mpr.dll" (netResource As _

.

   NETRESOURCE, password As String, Username As String, Flag As Integer) As Integer

.

NETRESOURCE

.

NETRESOURCE myNetResource = new NETRESOURCE();        

.

myNetResource.dwScope = 2;                    

.

myNetResource.dwType = 1 ;                    

.

myNetResource.dwDisplayType = 3;            

.

myNetResource.dwUsage = 1;            

.

myNetResource.LocalName = "z:";        

.

myNetResource.RemoteName = @"\servername\sharename";        

.

myNetResource.Provider = null;        

.

// int ret = WNetAddConnection2( myNetResource, "username", "password", 0);

.

int ret = WNetAddConnection2( myNetResource, "password", "username", 0); //by honglinlee

.

    var netResource = new NetResource()

.

        Scope = ResourceScope.GlobalNetwork,

.

        ResourceType = ResourceType.Disk,

.

        DisplayType = ResourceDisplaytype.Share,

.

        netResource,

.

    private static extern int WNetAddConnection2(NetResource netResource,

.

public class NetResource

.

    public ResourceScope Scope;

.

    public ResourceType ResourceType;

.

    public ResourceDisplaytype DisplayType;

.

public enum ResourceScope : int

.

public enum ResourceType : int

.

public enum ResourceDisplaytype : int

.

    public enum ResourceScope

.

        RESOURCE_CONNECTED = 1,

.

        RESOURCE_GLOBALNET,

.

        RESOURCE_REMEMBERED,

.

        RESOURCE_RECENT,

.

        RESOURCE_CONTEXT

.

    public enum ResourceType

.

        RESOURCETYPE_ANY,

.

        RESOURCETYPE_DISK,

.

        RESOURCETYPE_PRINT,

.

        RESOURCETYPE_RESERVED

.

    public enum ResourceUsage

.

        RESOURCEUSAGE_CONNECTABLE = 0x00000001,

.

        RESOURCEUSAGE_CONTAINER = 0x00000002,

.

        RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004,

.

        RESOURCEUSAGE_SIBLING = 0x00000008,

.

        RESOURCEUSAGE_ATTACHED = 0x00000010,

.

        RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),

.

    public enum ResourceDisplayType

.

        RESOURCEDISPLAYTYPE_GENERIC,

.

        RESOURCEDISPLAYTYPE_DOMAIN,

.

        RESOURCEDISPLAYTYPE_SERVER,

.

        RESOURCEDISPLAYTYPE_SHARE,

.

        RESOURCEDISPLAYTYPE_FILE,

.

        RESOURCEDISPLAYTYPE_GROUP,

.

        RESOURCEDISPLAYTYPE_NETWORK,

.

        RESOURCEDISPLAYTYPE_ROOT,

.

        RESOURCEDISPLAYTYPE_SHAREADMIN,

.

        RESOURCEDISPLAYTYPE_DIRECTORY,

.

        RESOURCEDISPLAYTYPE_TREE,

.

        RESOURCEDISPLAYTYPE_NDSCONTAINER

.

    private class NETRESOURCE

.

        public ResourceScope dwScope = 0;

.

        public ResourceType dwType = 0;

.

        public ResourceDisplayType dwDisplayType = 0;

.

        public ResourceUsage dwUsage = 0;

.

    private static extern int WNetAddConnection2(NETRESOURCE lpNetResource, string lpPassword, string lpUsername, int dwFlags);

.

        NETRESOURCE myNetResource = new NETRESOURCE();

.

        myNetResource.lpLocalName = drive;

.

        myNetResource.lpRemoteName = unc;

.

        myNetResource.lpProvider = null;

.

        int result = WNetAddConnection2(myNetResource, password, user, 0);

.

    Dim myResource As NETRESOURCE

.

    myResource.dwScope = 2

.

    myResource.dwType = 1

.

    myResource.dwDisplayType = 3

.

    myResource.LocalName = LocalName

.

    myResource.RemoteName = RemoteName

.

    myResource.dwUsage = Nothing

.

    myResource.Comment = Nothing

.

    myResource.Provider = Nothing

.

    returnValue = WNetAddConnection2(myResource, password, username, 0)

.

        MsgBox("Could not connect to " & myResource.RemoteName & ". The server said this: " & vbNewLine & vbNewLine & "(Error " & returnValue & ") " & errorM)

.

/* Uses Struct rather than class version of NETRESOURCE */

.

    ref NETRESOURCE lpNetResource, string lpPassword,

.

    ''' Use to pass handle to Provider of Network Resource

.

    ''' <param name="lpNetResource"></param>

.

                           ByRef lpNetResource As NETRESOURCE, _

.

NETRESOURCE

.

private const int RESOURCETYPE_ANY = 0x0;

.

NETRESOURCE ConnInf = new NETRESOURCE();

.

ConnInf.dwType = RESOURCETYPE_ANY;

.

WNetEnumResource

.

public static extern uint WNetEnumResource(IntPtr hEnum, ref int lpcCount, IntPtr lpBuffer, ref uint lpBufferSize);

.

Public Shared Function WNetEnumResource(hEnum As IntPtr, ByRef lpcCount As Integer, lpBuffer As IntPtr, ByRef lpBufferSize As UInteger) As UInteger

.

  public static extern int WNetEnumResource(

.

    RESOURCE_SCOPE dwScope,

.

    RESOURCE_TYPE dwType,

.

    RESOURCE_USAGE dwUsage,

.

    [MarshalAs(UnmanagedType.AsAny)][In] Object lpNetResource,

.

public enum RESOURCE_SCOPE

.

    RESOURCE_CONNECTED = 0x00000001,

.

    RESOURCE_GLOBALNET = 0x00000002,

.

    RESOURCE_REMEMBERED = 0x00000003,

.

    RESOURCE_RECENT= 0x00000004,

.

    RESOURCE_CONTEXT= 0x00000005

.

public enum RESOURCE_TYPE

.

    RESOURCETYPE_ANY= 0x00000000,

.

    RESOURCETYPE_DISK= 0x00000001,

.

    RESOURCETYPE_PRINT = 0x00000002,

.

    RESOURCETYPE_RESERVED = 0x00000008,

.

public enum RESOURCE_USAGE

.

    RESOURCEUSAGE_CONNECTABLE =0x00000001,

.

    RESOURCEUSAGE_CONTAINER=0x00000002,

.

    RESOURCEUSAGE_NOLOCALDEVICE =0x00000004,

.

    RESOURCEUSAGE_SIBLING=0x00000008,

.

    RESOURCEUSAGE_ATTACHED=0x00000010,

.

    RESOURCEUSAGE_ALL =(RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),

.

public enum RESOURCE_DISPLAYTYPE

.

    RESOURCEDISPLAYTYPE_GENERIC= 0x00000000,

.

    RESOURCEDISPLAYTYPE_DOMAIN= 0x00000001,

.

    RESOURCEDISPLAYTYPE_SERVER= 0x00000002,

.

    RESOURCEDISPLAYTYPE_SHARE= 0x00000003,

.

    RESOURCEDISPLAYTYPE_FILE = 0x00000004,

.

    RESOURCEDISPLAYTYPE_GROUP= 0x00000005,

.

    RESOURCEDISPLAYTYPE_NETWORK= 0x00000006,

.

    RESOURCEDISPLAYTYPE_ROOT = 0x00000007,

.

    RESOURCEDISPLAYTYPE_SHAREADMIN = 0x00000008,

.

    RESOURCEDISPLAYTYPE_DIRECTORY = 0x00000009,

.

    RESOURCEDISPLAYTYPE_TREE = 0x0000000A,

.

    RESOURCEDISPLAYTYPE_NDSCONTAINER = 0x0000000B

.

public struct NETRESOURCE

.

    public RESOURCE_SCOPE dwScope;

.

    public RESOURCE_TYPE dwType;

.

    public RESOURCE_DISPLAYTYPE dwDisplayType;

.

    public RESOURCE_USAGE dwUsage;

.

       RESOURCE_SCOPE.RESOURCE_GLOBALNET,

.

       RESOURCE_TYPE.RESOURCETYPE_ANY,

.

       RESOURCE_USAGE.RESOURCEUSAGE_ALL,

.

       NETRESOURCE nr;

.

     iRet =WNetEnumResource( ptrHandle, ref entries, ptrBuffer, ref buffer );

.

        nr = (NETRESOURCE)Marshal.PtrToStructure( ptr, typeof(NETRESOURCE) );

.

        if(RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER == (nr.dwUsage

.

            & RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER))

.

Module modEnumResource

.

    Public Enum RESOURCE_SCOPE

.

    RESOURCE_CONNECTED = &H1

.

    RESOURCE_GLOBALNET = &H2

.

    RESOURCE_REMEMBERED = &H3

.

    RESOURCE_RECENT = &H4

.

    RESOURCE_CONTEXT = &H5

.

    Public Enum RESOURCE_TYPE

.

    RESOURCETYPE_ANY = &H0

.

    RESOURCETYPE_DISK = &H1

.

    RESOURCETYPE_PRINT = &H2

.

    RESOURCETYPE_RESERVED = &H8

.

    Public Enum RESOURCE_USAGE

.

    RESOURCEUSAGE_CONNECTABLE = &H1

.

    RESOURCEUSAGE_CONTAINER = &H2

.

    RESOURCEUSAGE_NOLOCALDEVICE = &H4

.

    RESOURCEUSAGE_SIBLING = &H8

.

    RESOURCEUSAGE_ATTACHED = &H10

.

    RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE Or RESOURCEUSAGE_CONTAINER Or RESOURCEUSAGE_ATTACHED)

.

    Public Enum RESOURCE_DISPLAYTYPE

.

    RESOURCEDISPLAYTYPE_GENERIC = &H0

.

    RESOURCEDISPLAYTYPE_DOMAIN = &H1

.

    RESOURCEDISPLAYTYPE_SERVER = &H2

.

    RESOURCEDISPLAYTYPE_SHARE = &H3

.

    RESOURCEDISPLAYTYPE_FILE = &H4

.

    RESOURCEDISPLAYTYPE_GROUP = &H5

.

    RESOURCEDISPLAYTYPE_NETWORK = &H6

.

    RESOURCEDISPLAYTYPE_ROOT = &H7

.

    RESOURCEDISPLAYTYPE_SHAREADMIN = &H8

.

    RESOURCEDISPLAYTYPE_DIRECTORY = &H9

.

    RESOURCEDISPLAYTYPE_TREE = &HA

.

    RESOURCEDISPLAYTYPE_NDSCONTAINER = &HB

.

    Public Structure NETRESOURCE

.

    Public dwScope As RESOURCE_SCOPE

.

    Public dwType As RESOURCE_TYPE

.

    Public dwDisplayType As RESOURCE_DISPLAYTYPE

.

    Public dwUsage As RESOURCE_USAGE

.

    Public Function WNetEnumResource(ByVal hEnum As IntPtr, ByRef lpcCount As Integer, ByVal lpBuffer As IntPtr, ByRef lpBufferSize As Integer) As Integer

.

    Public Function WNetOpenEnum(ByVal dwScope As RESOURCE_SCOPE, ByVal dwType As RESOURCE_TYPE, ByVal dwUsage As RESOURCE_USAGE, ByRef lpNetResource As NETRESOURCE, ByRef lphEnum As IntPtr) As Integer

.

    Public Function GetNetworkDrives(ByRef o As NETRESOURCE, ByRef networkDriveCollection As List(Of String)) As Boolean

.

        iRet = WNetOpenEnum(RESOURCE_SCOPE.RESOURCE_REMEMBERED, RESOURCE_TYPE.RESOURCETYPE_ANY, RESOURCE_USAGE.RESOURCEUSAGE_ATTACHED, o, ptrHandle)

.

        Dim nr As NETRESOURCE

.

        iRet = WNetEnumResource(ptrHandle, entries, ptrBuffer, buffer)

.

            nr = CType(Marshal.PtrToStructure(ptr, GetType(NETRESOURCE)), NETRESOURCE)

.

            If (RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER = (nr.dwUsage And RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER)) Then

.

    Public Function GetNetworkComputers(ByRef o As NETRESOURCE, ByRef networkComputersCollection As List(Of String)) As Boolean

.

        iRet = WNetOpenEnum(RESOURCE_SCOPE.RESOURCE_GLOBALNET, RESOURCE_TYPE.RESOURCETYPE_ANY, RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER, o, ptrHandle)

.

        Dim nr As NETRESOURCE

.

        iRet = WNetEnumResource(ptrHandle, entries, ptrBuffer, buffer)

.

            nr = CType(Marshal.PtrToStructure(New IntPtr(ptr), GetType(NETRESOURCE)), NETRESOURCE)

.

            If (RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER = (nr.dwUsage And RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER)) Then

.

    Public Function WNETOE(ByRef o As NETRESOURCE, ByRef resourceCollection As List(Of String)) As Boolean

.

        iRet = WNetOpenEnum(RESOURCE_SCOPE.RESOURCE_GLOBALNET, RESOURCE_TYPE.RESOURCETYPE_ANY, RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER, o, ptrHandle)

.

        Dim nr As NETRESOURCE

.

        iRet = WNetEnumResource(ptrHandle, entries, ptrBuffer, buffer)

.

            nr = CType(Marshal.PtrToStructure(New IntPtr(ptr), GetType(NETRESOURCE)), NETRESOURCE)

.

            If (RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER = (nr.dwUsage And RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER)) Then

.

            If Not WNETOE(nr, resourceCollection) Then

.

            resourceCollection.Add(String.Format(nr.lpLocalName & " = " & nr.lpRemoteName))

.

        If ex.Message <> "" Then resourceCollection.Add(ex.Message)

.
Documentation
[WNetEnumResource] on MSDN
.

localName is the local name for the network resource (drive or printer)

.

remoteName is a string builder used to return the network name for the resource

.

public static extern UInt32 WNetOpenEnum(ResourceScope dwScope, ResourceType dwType, ResourceUsage dwUsage, NetResource lpNetResource, ref IntPtr lphEnum);

.

Public Shared Function WNetOpenEnum(dwScope As ResourceScope, dwType As ResourceType, dwUsage As ResourceUsage, lpNetResource As NetResource, ByRef lphEnum As IntPtr) As UInteger

.

ResourceScope, ResourceType, ResourceUsage, NetResource

.
Summary
Makes a connection to a network resource. The function can redirect a local device to a network resource.
.

    NETRESOURCE lpNetResource,

.

public enum ResourceScope

.

public enum ResourceType

.

public enum ResourceDisplayType

.

public enum ResourceUsage

.

private class NETRESOURCE

.

    public ResourceScope        dwScope       = 0;

.

    public ResourceType         dwType        = 0;

.

    public ResourceDisplayType  dwDisplayType = 0;

.

    public ResourceUsage        dwUsage       = 0;

.

    NETRESOURCE nr = new NETRESOURCE()

.

       dwType       = ResourceType.DISK,

.

    NETRESOURCE nr = new NETRESOURCE()

.

       dwType       = ResourceType.DISK,

ole32

.

Setting the delay too short (or zero) can have unintended consequences, as some DLL's will return control before they have finished cleaning up resources, or they will continue executing in the background.

.

Setting the delay too short (or zero) can have unintended consequences, as some DLL's will return control before they have finished cleaning up resources, or they will continue executing in the background.

.

        /// <summary> Release unmanaged resources </summary>

httpapi

.
Summary
The HttpTerminate function cleans up resources used by the HTTP API to process calls by an application. An application should call HttpTerminate once for every time it called HttpInitialize, with matching flag settings.

winscard

.
Summary
The SCardConnect function establishes a connection (using a specific resource manager context) between the calling application and a smart card contained by a specific reader. If no card exists in the specified reader, an error is returned.
.
Summary
The SCardEstablishContext function establishes the resource manager context (the scope) within which database operations are performed.
.

    // string cResourceToFree);

.
Summary
The SCardFreeMemory function releases memory that has been returned from the resource manager using the SCARD_AUTOALLOCATE length designator.
.

    /// <param name="hContext">A handle that identifies the resource manager context. The resource manager context is set by a previous call to the SCardEstablishContext function.</param>

.
Summary
The SCardReleaseContext function closes an established resource manager context, freeing any resources allocated under that context, including SCARDHANDLE objects and memory allocated using the SCARD_AUTOALLOCATE length designator.

ntdll

.

    ProcessResourceManagement,

shlwapi

.
Summary
Determines whether a path string represents a network resource.
.

''' Determines whether a path string represents a network resource.

.

''' <returns>Returns TRUE if the string represents a network resource, or FALSE otherwise.</returns>

.
Summary
Extracts the string from the specified resource when given an indirect string (a string beginning with the @ symbol). All other strings copy to the output buffer unaltered.
.

string resourcePath = "\System32\shell32.dll,-4123";

.

resourcePath = Environment.ExpandEnvironmentVariables(resourcePath);

.

int result = SHLoadIndirectString(resourcePath, outBuff, -1, IntPtr.Zero);

.

string sWin8ManifestString = "{C:\Program Files\WindowsApps\Microsoft.Video_6.2.8158.0_x86__8wekyb3d8bbwe\resources.pri?ms-resource://Microsoft.Video/resources/manifestVideoDisplayName}";

Enums

.

    /// The browse dialog box can display shareable resources on remote systems.

.

    ''' The browse dialog box can display shareable resources on remote systems.

23: CSIDL
.

    CSIDL_RESOURCES         = 0x0038,

.

    CSIDL_RESOURCES_LOCALIZED       = 0x0039,

.

    CSIDL_RESOURCES = &H38

.

    CSIDL_RESOURCES_LOCALIZED = &H39

.

        /** Transform resources of source PE. */

.

        DELTA_FLAG_RESOURCES = (0x00000010), /* flags[ 4 ] */

.

    ///Could not allocate some required resource (memory, events, ...)

.

    [Description("Could not allocate some required resource (memory, events, ...)")]

.

    public const int RPC_E_OUT_OF_RESOURCES = unchecked((int)0x80010101);

.

    ///There are insufficient resources to open another file.

.

    [Description("There are insufficient resources to open another file.")]

.

    ///Another single phase resource manager has already been enlisted in this transaction.

.

    [Description("Another single phase resource manager has already been enlisted in this transaction.")]

.

    ///Instead of committing, the resource heuristically aborted.

.

    [Description("Instead of committing, the resource heuristically aborted.")]

.

    ///Instead of aborting, the resource heuristically committed.

.

    [Description("Instead of aborting, the resource heuristically committed.")]

.

    ///Some of the states of the resource were committed while others were aborted, likely because of heuristic decisions.

.

    [Description("Some of the states of the resource were committed while others were aborted, likely because of heuristic decisions.")]

.

    ///Some of the states of the resource may have been committed while others may have been aborted, likely because of heuristic decisions.

.

    [Description("Some of the states of the resource may have been committed while others may have been aborted, likely because of heuristic decisions.")]

.

    ///There is no resource presently associated with this enlistment

.

    [Description("There is no resource presently associated with this enlistment")]

.

    public const int XACT_E_NORESOURCE = unchecked((int)0x8004D00C);

.

    ///The transaction failed to commit due to the failure of optimistic concurrency control in at least one of the resource managers.

.

    [Description("The transaction failed to commit due to the failure of optimistic concurrency control in at least one of the resource managers.")]

.

    ///The resource manager id is not associated with this transaction or the transaction manager.

.

    [Description("The resource manager id is not associated with this transaction or the transaction manager.")]

.

    ///The indicated unit of work does not match the unit of work expected by the resource manager.

.

    [Description("The indicated unit of work does not match the unit of work expected by the resource manager.")]

.

    ///The transaction status is in doubt. A communication failure occurred, or a transaction manager or resource manager has failed

.

    [Description("The transaction status is in doubt. A communication failure occurred, or a transaction manager or resource manager has failed")]

.

    ///Resource manager reenlistment to determine transaction status timed out.

.

    [Description("Resource manager reenlistment to determine transaction status timed out.")]

.

    ///The transaction was successfully aborted. However, this is a coordinated transaction, and some number of enlisted resources were aborted outright because they could not support abort-retaining semantics

.

    [Description("The transaction was successfully aborted. However, this is a coordinated transaction, and some number of enlisted resources were aborted outright because they could not support abort-retaining semantics")]

.

    ///The sink is content and wishes the transaction to proceed. Changes were made to one or more resources during this call.

.

    [Description("The sink is content and wishes the transaction to proceed. Changes were made to one or more resources during this call.")]

.

    ///The resource manager has performed a single-phase commit of the transaction.

.

    [Description("The resource manager has performed a single-phase commit of the transaction.")]

.

    ///The resource manager has requested to be the coordinator (last resource manager) for the transaction.

.

    [Description("The resource manager has requested to be the coordinator (last resource manager) for the transaction.")]

.

    public const int XACT_S_LASTRESOURCEMANAGER = unchecked((int)0x0004D010);

.

    ///OSS ASN.1 Error: System resource error.

.

    [Description("OSS ASN.1 Error: System resource error.")]

.

    ///The Smart card resource manager is not running.

.

    [Description("The Smart card resource manager is not running.")]

.

    ///The Smart card resource manager has shut down.

.

    [Description("The Smart card resource manager has shut down.")]

.

    ///The Smart card resource manager is too busy to complete this operation.

.

    [Description("The Smart card resource manager is too busy to complete this operation.")]

.

    ///Cannot create a duplicate resource of type Distributed Transaction Coordinator

.

    [Description("Cannot create a duplicate resource of type Distributed Transaction Coordinator")]

.

    public const int MSDTC_E_DUPLICATE_RESOURCE = unchecked((int)0x80110701);

.

    '''Could not allocate some required resource (memory, events, ...)

.

    <Description("Could not allocate some required resource (memory, events, ...)")> _

.

    Public Const RPC_E_OUT_OF_RESOURCES As Integer = CInt(&H80010101UI)

.

    '''There are insufficient resources to open another file.

.

    <Description("There are insufficient resources to open another file.")> _

.

    '''Another single phase resource manager has already been enlisted in this transaction.

.

    <Description("Another single phase resource manager has already been enlisted in this transaction.")> _

.

    '''Instead of committing, the resource heuristically aborted.

.

    <Description("Instead of committing, the resource heuristically aborted.")> _

.

    '''Instead of aborting, the resource heuristically committed.

.

    <Description("Instead of aborting, the resource heuristically committed.")> _

.

    '''Some of the states of the resource were committed while others were aborted, likely because of heuristic decisions.

.

    <Description("Some of the states of the resource were committed while others were aborted, likely because of heuristic decisions.")> _

.

    '''Some of the states of the resource may have been committed while others may have been aborted, likely because of heuristic decisions.

.

    <Description("Some of the states of the resource may have been committed while others may have been aborted, likely because of heuristic decisions.")> _

.

    '''There is no resource presently associated with this enlistment

.

    <Description("There is no resource presently associated with this enlistment")> _

.

    Public Const XACT_E_NORESOURCE As Integer = CInt(&H8004d00cUI)

.

    '''The transaction failed to commit due to the failure of optimistic concurrency control in at least one of the resource managers.

.

    <Description("The transaction failed to commit due to the failure of optimistic concurrency control in at least one of the resource managers.")> _

.

    '''The resource manager id is not associated with this transaction or the transaction manager.

.

    <Description("The resource manager id is not associated with this transaction or the transaction manager.")> _

.

    '''The indicated unit of work does not match the unit of work expected by the resource manager.

.

    <Description("The indicated unit of work does not match the unit of work expected by the resource manager.")> _

.

    '''The transaction status is in doubt. A communication failure occurred, or a transaction manager or resource manager has failed

.

    <Description("The transaction status is in doubt. A communication failure occurred, or a transaction manager or resource manager has failed")> _

.

    '''Resource manager reenlistment to determine transaction status timed out.

.

    <Description("Resource manager reenlistment to determine transaction status timed out.")> _

.

    '''The transaction was successfully aborted. However, this is a coordinated transaction, and some number of enlisted resources were aborted outright because they could not support abort-retaining semantics

.

    <Description("The transaction was successfully aborted. However, this is a coordinated transaction, and some number of enlisted resources were aborted outright because they could not support abort-retaining semantics")> _

.

    '''The sink is content and wishes the transaction to proceed. Changes were made to one or more resources during this call.

.

    <Description("The sink is content and wishes the transaction to proceed. Changes were made to one or more resources during this call.")> _

.

    '''The resource manager has performed a single-phase commit of the transaction.

.

    <Description("The resource manager has performed a single-phase commit of the transaction.")> _

.

    '''The resource manager has requested to be the coordinator (last resource manager) for the transaction.

.

    <Description("The resource manager has requested to be the coordinator (last resource manager) for the transaction.")> _

.

    Public Const XACT_S_LASTRESOURCEMANAGER As Integer = CInt(&H4d010)

.

    '''OSS ASN.1 Error: System resource error.

.

    <Description("OSS ASN.1 Error: System resource error.")> _

.

    '''The Smart card resource manager is not running.

.

    <Description("The Smart card resource manager is not running.")> _

.

    '''The Smart card resource manager has shut down.

.

    <Description("The Smart card resource manager has shut down.")> _

.

    '''The Smart card resource manager is too busy to complete this operation.

.

    <Description("The Smart card resource manager is too busy to complete this operation.")> _

.

    '''Cannot create a duplicate resource of type Distributed Transaction Coordinator

.

    <Description("Cannot create a duplicate resource of type Distributed Transaction Coordinator")> _

.

    Public Const MSDTC_E_DUPLICATE_RESOURCE As Integer = CInt(&H80110701UI)

.

      LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x00000020,

.

    LOAD_LIBRARY_AS_IMAGE_RESOURCE = &H20

.

    ResourceDataNotFound = 0xc0000089,

.

    ResourceTypeNotFound = 0xc000008a,

.

    ResourceNameNotFound = 0xc000008b,

.

    ResourceInUse = 0xc0000708,

.

        /// <summary>641. The server cannot allocate NetBIOS resources needed to support the client. </summary>

.

        ERROR_SERVER_OUT_OF_RESOURCES,

.

        /// <summary>818. The Network Access Protection (NAP) enforcement client could not create system resources for remote access connections. Some network services or resources might not be available. </summary>

.

        ERROR_RASQEC_RESOURCE_CREATION_FAILED,

.

        /// <summary>819. The Network Access Protection Agent (NAP Agent) service has been disabled or is not installed on this computer. Some network services or resources might not be available. </summary>

.

        /// <summary>820. The Network Access Protection (NAP) enforcement client failed to register with the Network Access Protection Agent (NAP Agent) service. Some network services or resources might not be available. </summary>

.

        /// <summary>822. The Network Access Protection (NAP) enforcement client did not respond. Some network services or resources might not be available. </summary>

.

        RegResourceList = 8,

.

        RegFullResourceDescriptor = 9,

.

        RegResourceRequirementsList = 10,

.

private enum ResourceDisplayType : uint

.

Private Enum ResourceDisplayType As UInteger

.
Documentation
[ResourceDisplayType] on MSDN
.

private enum ResourceScope : uint

.

Private Enum ResourceScope As UInteger

.
Documentation
[ResourceScope] on MSDN
.
Summary
The type of resource. This member can be one of the following values defined in the Winnetwk.h header file.
.

private enum ResourceType : uint

.

Private Enum ResourceType As UInteger

.
Documentation
[ResourceType] on MSDN
.
Summary
A set of bit flags describing how the resource can be used.Note that this member can be specified only if the dwScope member is equal to RESOURCE_GLOBALNET. This member can be one of the following values defined in the Winnetwk.h header file.
.

private enum ResourceUsage : uint

.

Private Enum ResourceUsage As UInteger

.
Documentation
[ResourceUsage] on MSDN
.

The .NET Framework equivalent is System.Security.AccessControl.ResourceType (http://msdn2.microsoft.com/library/System.Security.AccessControl.ResourceType).

.

        SHCONTF_SHAREABLE       = 0x0400,   // hint that client is looking sharable resources (remote shares)

.

    SHCONTF_SHAREABLE = &H400      ' hint that client is looking sharable resources (remote shares)

.

        SHAREABLE = &H400    '  . The calling application is looking for resources that can be shared.

.

        FASTITEMS = &H2000     '  . Windows Vista and later   '  . The calling application is looking for resources that can be enumerated quickly.

.

    /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources.

.

    '''An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources.

.

    ''' pool of font resources.

.

        /// Clean up any resources being used.

.

    wlan_hosted_network_reason_insufficient_resources,

gdiplus

.
Summary
The GdiplusShutdown function cleans up resources used by GDI+. Each call to GdiplusStartup should be paired with a call to GdiplusShutdown.

rasapi32

.
Summary
The RasHangUp function terminates a remote access connection. The connection is specified with a RAS connection handle. The function releases all RASAPI32.DLL resources associated with the handle

Structures

40: ACTCTX
.

     public string lpResourceName;

.

    Public lpResourceName As String

.

        public string        lpVerb;        // either a string or MAKEINTRESOURCE(idOffset)

.

     /// but it may not have access to network resources.

.

        public IMAGE_DATA_DIRECTORY ResourceTable;

.

        public IMAGE_DATA_DIRECTORY ResourceTable;

.

    public IMAGE_DATA_DIRECTORY ResourceTable;

.
.
Summary
Contains information about a network resource.
.

public class NetResource

.

    public ResourceScope dwScope;

.

    public ResourceType dwType;

.

    public ResourceDisplayType dwDisplayType;

.

    public ResourceUsage dwUsage;

.

Public Class NetResource

.

    Public dwScope As ResourceScope

.

    Public dwType As ResourceType

.

    Public dwDisplayType As ResourceDisplayType

.

    Public dwUsage As ResourceUsage

.

ResourceScope, ResourceType, ResourceDisplayType, ResourceUsage

.
Documentation
[NETRESOURCE] on MSDN
.

    ''' The name of the dialog template resource in the module identified by the hInstance member.

.

        /// Clean up any resources being used.

.

    /// The type of data in the version resource.

.

    /// This member is 1 if the version resource contains text data and 0 if the version resource contains binary data.

.

    '' The type of data in the version resource.

.

    '' This member is 1 if the version resource contains text data and 0 if the version resource contains binary data.

.
    • Specifies the number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses WNDCLASSEX to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA.
.
    • Handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon.
.
    • Handle to the class cursor. This member must be a handle to a cursor resource. If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window.
.
    • Pointer to a null-terminated character string that specifies the resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the MAKEINTRESOURCE macro. If this member is NULL, windows belonging to this class have no default menu.
.
    • Handle to a small icon that is associated with the window class. If this member is NULL, the system searches the icon resource specified by the hIcon member for an icon of the appropriate size to use as the small icon.
.
    • Specifies the number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses WNDCLASSEX to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA.
.
    • Handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon.
.
    • Handle to the class cursor. This member must be a handle to a cursor resource. If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window.
.
    • Pointer to a null-terminated character string that specifies the resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the MAKEINTRESOURCE macro. If this member is NULL, windows belonging to this class have no default menu.
.
    • Handle to a small icon that is associated with the window class. If this member is NULL, the system searches the icon resource specified by the hIcon member for an icon of the appropriate size to use as the small icon.

gdi32

.
Summary
Adds the font resource from a memory image to the system.
.

private static extern IntPtr AddFontMemResourceEx(byte[] pbFont, int cbFont, IntPtr pdv, out uint pcFonts);

.

When the function succeeds, the caller of this function can free the memory pointed to by pbFont because the system has made its own copy of the memory. To remove the fonts that were installed, call RemoveFontMemResourceEx. However, when the process goes away, the system will unload the fonts even if the process did not call RemoveFontMemResourceEx.

.

byte[] fontdata = MyAssembly.Properties.Resources.ZeroThreesFont; // Getting Zero Threes embedded font from Resources (.NET 2.0)

.

AddFontMemResourceEx(fontdata, fontdata.Length, IntPtr.Zero, out cFonts);

.
Documentation
[AddFontMemResourceEx] on MSDN
.
Summary
Adds the font resource from the specified file to the system.
.

static extern int AddFontResourceEx(string lpszFilename, uint fl, IntPtr pdv);

.
Documentation
[AddFontResourceEx] on MSDN
.

After you're done, you should use DeleteObject to release resources.

.
Summary
.

static extern bool CreateScalableFontResource(uint fdwHidden, string

.

                    if (CreateScalableFontResourceA(1,

.
Documentation
[CreateScalableFontResource] on MSDN
.

Please call DeleteObject to free up all system resources.

.
Summary
The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid.
.

/// <summary>Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid.</summary>

.

    /// Deletes a logical pen, brush, font, bitmap, region, or palette handle freeing all system resources associated with the object.

.
Summary
.

static extern bool RemoveFontResource(string lpFileName);

.

  namespace FontResource

.

    static extern int AddFontResource(string lpFilename);

.

    static extern bool RemoveFontResource(string lpFileName);

.

            AddFontResource(args[1]);

.

            RemoveFontResource(args[1]);

.

        Console.WriteLine("FontResource [add|rem] <font>");

.
Documentation
[RemoveFontResource] on MSDN
.

        /// Clean up any resources being used.

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


 
Access PInvoke.net directly from VS: