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]

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.

Interfaces

.

        void OnLowResource([In] uint reserved);

.

     BINDSTATUS_FINDINGRESOURCE      = 1

.

        INET_E_RESOURCE_NOT_FOUND = 0x800C0005,

.

        /// Dispose and free used resources

.

        public void OnLowResource( uint reserved )

.

                case HRESULTS.INET_E_RESOURCE_NOT_FOUND:

.

                    Description = "Resource Not Found.";break;

.

    /// Gets the set of properties of the manifest resource with the specified metadata signature.

.

    /// <param name="mdmr">[in] An <c>mdManifestResource</c> token that represents the resource for which to get the properties. </param>

.

    /// <param name="ptkImplementation">[out] A pointer to an <c>mdFile</c> token or an mdAssemblyRef token that represents the file or assembly, respectively, that contains the resource. </param>

.

    /// <param name="pdwOffset">[out] A pointer to a value that specifies the offset to the beginning of the resource within the file.</param>

.

    /// <param name="pdwResourceFlags">[out] A pointer to flags that describe the metadata applied to a resource. The flags value is a combination of one or more <c>CorManifestResourceFlags</c> values.</param>

.

    /// STDMETHOD(GetManifestResourceProps)(    // S_OK or error.

.

    ///     mdManifestResource  mdmr,       // [IN] The ManifestResource for which to get the properties.

.

    ///     mdToken     *ptkImplementation,     // [OUT] mdFile or mdAssemblyRef that provides the ManifestResource.

.

    ///     DWORD       *pdwOffset,         // [OUT] Offset to the beginning of the resource within the file.

.

    ///     DWORD       *pdwResourceFlags) PURE;// [OUT] Flags.

.

    void GetManifestResourceProps(

.

        [Out] out CorManifestResourceFlags pdwResourceFlags);

.

    /// Gets a pointer to an enumerator for the resources referenced in the current assembly manifest.

.

    /// <param name="phEnum">[in, out] A pointer to the enumerator. This must be a null value when the <c>EnumManifestResources</c> method is called for the first time.</param>

.

    /// <param name="rManifestResources">[out] The array used to store the <c>mdManifestResource</c> metadata tokens.</param>

.

    /// <param name="cMax">[in] The maximum number of <c>mdManifestResource</c> tokens that can be placed in <c>rManifestResources</c>.</param>

.

    /// <param name="pcTokens">[out] The number of <c>mdManifestResource</c> tokens actually placed in <c>rManifestResources</c>.</param>

.

    /// STDMETHOD(EnumManifestResources)(       // S_OK or error

.

    ///     mdManifestResource  rManifestResources[],   // [OUT] Put ManifestResources here.

.

    ///     ULONG       cMax,           // [IN] Max Resources to put.

.

    void EnumManifestResources(

.

        [Out, MarshalAs(UnmanagedType.LPArray)] uint[] rManifestResources,

.

    /// Gets a pointer to the manifest resource with the specified name.

.

    /// <param name="szName">[in] The name of the resource.</param>

.

    /// <param name="ptkManifestResource">[out] The array used to store the <c>mdManifestResource</c> metadata tokens, each of which represents a manifest resource.</param>

.

    /// STDMETHOD(FindManifestResourceByName)(  // S_OK or error

.

    ///     LPCWSTR     szName,         // [IN] Name of the ManifestResource.

.

    ///     mdManifestResource *ptkManifestResource) PURE;  // [OUT] Put the ManifestResource token here.

.

    void FindManifestResourceByName(

.

        [Out] out uint ptkManifestResource);

.

    ffContainsMetaData      =   0x0000,     // This is not a resource file

.

    ffContainsNoMetaData    =   0x0001,     // This is a resource file or other non-metadata-containing file

.

    public enum CorManifestResourceFlags : uint {

.

    mrPublic        =   0x0001,     // The Resource is exported from the Assembly.

.

    mrPrivate           =   0x0002,     // The Resource is private to the Assembly.

.

        /// <param name="hInstAnimation">An instance handle to the module from which the AVI resource should be loaded.</param>

.

        /// <param name="idAnimation">An AVI resource identifier. To create this value, use the MAKEINTRESOURCE macro. The control loads the AVI resource from the module specified by hInstAnimation.</param>

.

     HRESULT LoadUI(IntPtr instance, [MarshalAs(UnmanagedType.LPWStr)] string resourceName);

winfax

.
Summary
Releases resources associated with a buffer allocated previously as the result of a function call by a fax client application.

kernel32

.

    public UInt16 lpResourceName;

.

    private const uint ACTCTX_FLAG_RESOURCE_NAME_VALID = 0x008;

.

    private const uint CREATEPROCESS_MANIFEST_RESOURCE_ID = 1;

.

    private const uint ISOLATIONAWARE_MANIFEST_RESOURCE_ID = 2;

.

    private const uint ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID = 3;

.

    actCtx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;

.

    actCtx.lpResourceName = ISOLATIONAWARE_MANIFEST_RESOURCE_ID;

.

        actCtx.lpResourceName = ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID;

.

        actCtx.lpResourceName = CREATEPROCESS_MANIFEST_RESOURCE_ID;

.

Resources

.

Resources

.
Summary
.

static extern IntPtr BeginUpdateResource(string pFileName,

.

   [MarshalAs(UnmanagedType.Bool)]bool bDeleteExistingResources);

.

    Public Shared Function BeginUpdateResource(ByVal pFileName As String, _

.

    <MarshalAs(UnmanagedType.Bool)> ByVal bDeleteExistingResources As Boolean) As IntPtr

.

   IntPtr hResource = BeginUpdateResource(mFileName, false);

.

   if (hResource.ToInt32() == 0) {

.

     if (UpdateResource(hResource, "FILE", fileName,

.

   if (EndUpdateResource(hResource, false) == false) {

.
Documentation
[BeginUpdateResource] on MSDN
.

internal static extern IntPtr CreateMemoryResourceNotification(MemoryResourceNotificationType notificationType);

.

enum MemoryResourceNotificationType : int

.

    LowMemoryResourceNotification = 0,

.

    HighMemoryResourceNotification = 1,

.
Documentation
[CreateMemoryResourceNotification] on MSDN
.
Summary
.

static extern bool EndUpdateResource(IntPtr hUpdate, bool fDiscard);

.

Public Shared Function EndUpdateResource(ByVal hUpdate As IntPtr, ByVal fDiscard As Boolean) As Boolean

.

hUpdate is returned from BeginUpdateResource.

.
Documentation
[EndUpdateResource] on MSDN
.
Summary
.

static extern bool EnumResourceLanguages(IntPtr hModule, string lpszType,

.
Documentation
[EnumResourceLanguages] on MSDN
.
Summary
.

static extern bool EnumResourceNames(IntPtr hModule, string lpszType, EnumResNameProcDelegate lpEnumFunc, IntPtr lParam);

.

static extern bool EnumResourceNames(IntPtr hModule, int dwID, EnumResNameProcDelegate lpEnumFunc, IntPtr lParam);

.

<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _

.

Private Shared Function EnumResourceNames(ByVal hModule As IntPtr, ByVal lpszType As String, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Boolean

.

<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _

.

Private Shared Function EnumResourceNames(ByVal hModule As IntPtr, ByVal dwID As Integer, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Boolean

.

Public Enum ResourceType

.

    <DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _

.

    Private Shared Function EnumResourceNames(ByVal hModule As IntPtr, ByVal lpszType As String, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Boolean

.

    <DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _

.

    Private Shared Function EnumResourceNames(ByVal hModule As IntPtr, ByVal lpszType As Integer, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Integer

.

    Private Sub ShowResources()

.

            EnumResourceNames(dll_hInst, "AVI", AddressOf EnumResNameProc, IntPtr.Zero)

.

    [DllImport("kernel32.dll", EntryPoint = "EnumResourceNamesW", CharSet = CharSet.Unicode, SetLastError = true)]

.

    static extern bool EnumResourceNamesWithName(

.

    [DllImport("kernel32.dll", EntryPoint = "EnumResourceNamesW", CharSet = CharSet.Unicode, SetLastError = true)]

.

    static extern bool EnumResourceNamesWithID(

.

    private static bool IS_INTRESOURCE(IntPtr value)

.

    private static uint GET_RESOURCE_ID(IntPtr value)

.

      if (IS_INTRESOURCE(value) == true)

.

    private static string GET_RESOURCE_NAME(IntPtr value)

.

      if (IS_INTRESOURCE(value) == true)

.

      IntPtr hMod = LoadLibraryEx(@"D:\Test\StringResource\Debug\StringResource.exe", IntPtr.Zero, LOAD_LIBRARY_AS_DATAFILE);

.

      if (EnumResourceNamesWithID(hMod, RT_ICON, new EnumResNameDelegate(EnumRes), IntPtr.Zero) == false)

.

      Console.WriteLine("Type: {0}", GET_RESOURCE_NAME(lpszType));

.

      Console.WriteLine("Name: {0}", GET_RESOURCE_NAME(lpszName));

.
Documentation
[EnumResourceNames] on MSDN
.
Summary
.

static extern bool EnumResourceTypes(IntPtr hModule, EnumResTypeProc lpEnumFunc, IntPtr lParam);

.

Private Shared Function EnumResourceTypes(ByVal hModule As IntPtr, ByVal lpEnumFunc As EnumResTypeProc, ByVal lParam As IntPtr) As Boolean

.

    ''' Enumerates a module for predefined resource types.

.

    ''' <param name="resources">If NULL, all resource types will be enumerated.</param>

.

    Public Shared Function GetResourceTypes(fullPath As String, _

.

                  resources() As ResourceType) As Dictionary(Of ResourceType,  _

.

    If IsNothing(resources) OrElse resources.Length = 0 Then resources = _

.

        CType([Enum].GetValues(GetType(ResourceType)), ResourceType())

.

    Dim LS As New Dictionary(Of ResourceType, List(Of String))

.

         Dim rt = CType(CInt(lpType), ResourceType)

.

         Dim ResID = MAKEINTRESOURCE(lpzName)

.

        Dim rt = CType(CInt(rType), ResourceType)

.

        If Array.IndexOf(resources, rt) > -1 Then

.

            EnumResourceNames(hm, rType, typeCallBack, IntPtr.Zero)

.

    EnumResourceTypesW(hMod, callBack, IntPtr.Zero)

.
Documentation
[EnumResourceTypes] on MSDN
.

    LOCALE_SPARENT        =0x0000006d,   // Fallback name for resources

.

    LOCALE_SPARENT        =0x0000006d,   // Fallback name for resources

. .
Summary
.

static extern IntPtr FindResourceEx(IntPtr hModule, IntPtr lpType, IntPtr lpName, ushort wLanguage);

.

Private Shared Function FindResourceEx(ByVal hModule As IntPtr, ByVal lpType As IntPtr, ByVal lpName As IntPtr, ByVal wLanguage As UShort) As IntPtr

.
Documentation
[FindResourceEx] on MSDN
. .
Summary
.

static extern IntPtr FindResourceEx(IntPtr hModule, IntPtr lpType,

.
Documentation
[FindResourceEx] on MSDN
.

      if (EnumResourceNames(hExe, "FILE", cb, (IntPtr)gch) == false) {

.

    LOCALE_SPARENT        =0x0000006d,   // Fallback name for resources

.

    LOCALE_SPARENT        =0x0000006d,   // Fallback name for resources

.

            Resources.Strings.ProjectNotFound,

.

If you only want to load resources from the library, specify LoadLibraryFlags.LoadLibraryAsDatafile as dwFlags. In this case, nothing is done to execute or prepare to execute the mapped file.

.

If you only want to load resources from the library, specify LoadLibraryFlags.LoadLibraryAsDatafile as dwFlags. In this case, nothing is done to execute or prepare to execute the mapped file.

. .
Summary
.

static extern IntPtr LoadResource(IntPtr hModule, IntPtr hResInfo);

.

Private Shared Function LoadResource(hModule As IntPtr, hResInfo As IntPtr) As IntPtr

.

hModule is the handle to the module in the executable, returned by FindResource

.

hResInfo is the return value from FindResource.

.
Documentation
[LoadResource] on MSDN
.
Summary
.

static extern IntPtr LockResource(IntPtr hResData);

.

Private Shared Function LockResource(hResData As IntPtr) As IntPtr

.

this function returnes a pointer to the resource. you can use Marshal.Copy() to copy the data from the pointer to a managed array.

.

      pResource = LockResource(hResource);

.

      if (hResource.ToInt32() == 0) {

.

      Marshal.Copy(pResource, fileBuffComp, 0, fileSizeComp + mOffset);

.

    [DllImport("Kernel32.dll", EntryPoint = "FindResourceW", SetLastError = true, CharSet = CharSet.Unicode)]

.

    private static extern IntPtr FindResource(IntPtr hModule, string pName, string pType);

.

    [DllImport("Kernel32.dll", EntryPoint = "SizeofResource", SetLastError = true)]

.

    private static extern uint SizeofResource(IntPtr hModule, IntPtr hResource);

.

    [DllImport("Kernel32.dll", EntryPoint = "LoadResource", SetLastError = true)]

.

    private static extern IntPtr LoadResource(IntPtr hModule, IntPtr hResource);

.

    [DllImport("Kernel32.dll", EntryPoint = "LockResource")]

.

    private static extern IntPtr LockResource(IntPtr hGlobal);

.

    internal static int TestFindResource()

.

    IntPtr resH1 = FindResource(IntPtr.Zero, "RES_CUSTOMIZE", "CUSTOM");

.

    IntPtr resH2 = LoadResource(IntPtr.Zero, resH1);

.

    IntPtr resH3 = LockResource(resH2);

.

    uint resSize = SizeofResource(IntPtr.Zero, resH1);

.
Documentation
[LockResource] on MSDN
.

    public string resourceId;

.

internal static extern bool QueryMemoryResourceNotification(IntPtr resourceNotificationHandle, out int resourceState);

.
Documentation
[QueryMemoryResourceNotification] on MSDN
.
Summary
.

static extern uint SizeofResource(IntPtr hModule, IntPtr hResInfo);

.

Private Shared Function SizeofResource(hModule As IntPtr, hResInfo As IntPtr) As UInteger

.
Documentation
[SizeofResource] on MSDN
.

    //free up resources

.
Summary
.

static extern bool UpdateResource(IntPtr hUpdate, IntPtr lpType, IntPtr lpName, ushort wLanguage, IntPtr lpData, uint cbData);

.

<DllImport("kernel32.dll", EntryPoint:="UpdateResource", SetLastError:=True)> _

.

Friend Shared Function UpdateResource(hUpdate As IntPtr, lpType As IntPtr, lpName As IntPtr, wLanguage As UShort, <MarshalAs(UnmanagedType.LPArray, SizeParamIndex:=5)> lpData As Byte(), cbData As UInteger) As <MarshalAs(UnmanagedType.Bool)> Boolean

.

See BeginUpdateResource to get a handle for hUpdate, and EndUpdateResource to apply the update changes.

.

Most if not all windows resource names are actually numbers, not strings (but some utilities such as Resource Hacker do not show the data type of the resource name). I'm not actually sure if the data type is unsigned 16 bit, but that's the most conservative choice and it does work.

.
Documentation
[UpdateResource] on MSDN

cards

.
Summary
Disposes card resources.

rapi

.
Summary
This function creates, opens, or truncates a file, pipe, communications resource, disk device, or console. It returns a handle that can be used to access the object. It can also open and return a handle to a directory.

advapi32

.

    const uint STATUS_INSUFFICIENT_RESOURCES = 0xc000009a;

.

        if ((ret == STATUS_INSUFFICIENT_RESOURCES) || (ret == STATUS_NO_MEMORY))

.

        if ((ret == STATUS_INSUFFICIENT_RESOURCES) || (ret == STATUS_NO_MEMORY))

.

    const uint STATUS_INSUFFICIENT_RESOURCES = 0xc000009a;

.

        if ((ret == STATUS_INSUFFICIENT_RESOURCES) || (ret == STATUS_NO_MEMORY))

.

        if (ret == STATUS_INSUFFICIENT_RESOURCES || ret == STATUS_NO_MEMORY)

.

        if (ret == STATUS_INSUFFICIENT_RESOURCES || ret == STATUS_NO_MEMORY)

.

        if ((ret == STATUS_INSUFFICIENT_RESOURCES) || (ret == STATUS_NO_MEMORY))

.

        if ((ret == STATUS_INSUFFICIENT_RESOURCES) || (ret == STATUS_NO_MEMORY))

.

   //Implement IDisposable. (from Implementing Finalize and Dispose to Clean Up Unmanaged Resources )

.

(Special Note: The .NET Framework (3.0 and earlier at least) cannot read registry values of special types (for example: REG_RESOURCE_LIST and REG_FULL_RESOURCE_DESCRIPTOR). I am not sure if they will ever be available under .NET, to see examples of these types of values at work, visit your registry under (HKLM\HARDWARE\DESCRIPTION\System) and (HKLM\HARDWARE\RESOURCEMAP\Hardware Abstraction Layer\ACPI x86 platform).

.

        RegResourceList = 8,

.

        RegFullResourceDescriptor = 9,

.

        RegResourceRequirementsList = 10,

.

static extern unsafe uint RegisterTraceGuids([In] EtwProc cbFunc, [In] void* context, [In] ref Guid controlGuid, [In] uint guidCount, ref TraceGuidRegistration guidReg, [In] string mofImagePath, [In] string mofResourceName, out ulong regHandle);

.

static extern unsafe uint RegisterTraceGuids([In] EtwProc cbFunc, [In] void* context, [In] ref Guid controlGuid, [In] uint guidCount, ref TraceGuidRegistration guidReg, [In] string mofImagePath, [In] string mofResourceName, out ulong regHandle);

.
Summary
The WNetGetUniversalName function takes a drive-based path for a network resource and returns an information structure that contains a more universal form of the name. What this means is that you can take a file name from a network drive can be converted to a UNC version that may be used from other computers on the network that do not have the same drive mappings.

ntdll

.

    ProcessResourceManagement,

winmm

.
Summary
Plays a PCM sound file from a filename, resource name or registry alias
.

    /// <summary>name is resource name or atom</summary>

.

    SND_RESOURCE = 0x00040004

.

    ''' the resource needed to generate that sound is busy playing

.

    ''' SND_FILENAME or SND_RESOURCE.

.

    ''' The pszSound parameter is a resource identifier; hmod must

.

    ''' identify the instance that contains the resource.

.

    SND_RESOURCE = &H40004

.

the resources previously set up:

coredll

.

    ''' Releases all resources held by the current WaitEvent.

.

So the device ID is a very useful thing for software that wants to target just your device, e.g. copy protection, or to provide immutable identity to web service calls. Equally so it’s a resource that should be protected to mitigate the risk of identity theft.

.
Summary
This function loads the specified icon resource from the executable (.exe) file associated with an application instance.
.

            // Obtains the app icon (the resource number is fixed for all apps) for the current

.

        SND_RESOURCE = &H40004          ' name is resource name or atom

.

        SND_RESOURCE = 0x40004,        // name is resource name or atom

.

            SND_RESOURCE = 0x40004, // name is resource name or atom

.

            SND_RESOURCE = &H40004          ' name is resource name or atom

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

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


 
Access PInvoke.net directly from VS: