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

dnsapi

.

  <DllImport("dnsapi.dll", EntryPoint:="DnsFlushResolverCacheEntry_W", CharSet:=CharSet.Unicode)> _

.

[DllImport("dnsapi.dll", SetLastError=true)]

.

  <DllImport("dnsapi.dll", EntryPoint:="DnsFlushResolverCacheEntry_W", CharSet:=CharSet.Unicode)> _

.

[DllImport("dnsapi", EntryPoint = "DnsQueryEx", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]

.

        DNS_QUERY_DONT_RESET_TTL_VALUES = 0x100000,

.

        context.eventHandle = new EventWaitHandle(false, EventResetMode.ManualReset);

.

        context.eventHandle.Set();

.

        context.eventHandle.Set();

.

    [DllImport("dnsapi", EntryPoint = "DnsQueryEx", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]

.

    [DllImport("dnsapi", CharSet = CharSet.Auto, SetLastError = true)]

.

    [DllImport("dnsapi", SetLastError = true)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        set { this.Data = (this.Data & ~0x3u) | (value & 0x3u); }

.

        set { this.Data = (this.Data & ~(0x1u << 2)) | (value & 0x1u) << 2; }

.

        public uint CharSet

.

        set { this.Data = (this.Data & ~(0x3u << 3)) | (value & 0x3u) << 3; }

.

        set { this.Data = (this.Data & ~(0x7u << 5)) | (value & 0x7u) << 5; }

.

        set { this.Data = (this.Data & ~(0xFFFFFFu << 8)) | (value & 0xFFFFFFu) << 8; }

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        set

.

        set

.

        set

.

        set

.

        set

.

        set

.

[DllImport("dnsapi", EntryPoint = "DnsQueryEx", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]

.

        DNS_QUERY_DONT_RESET_TTL_VALUES = 0x100000,

.

        context.eventHandle = new EventWaitHandle(false, EventResetMode.ManualReset);

.

        context.eventHandle.Set();

.

        context.eventHandle.Set();

.

    [DllImport("dnsapi", EntryPoint = "DnsQueryEx", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]

.

    [DllImport("dnsapi", CharSet = CharSet.Auto, SetLastError = true)]

.

    [DllImport("dnsapi", SetLastError = true)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        set { this.Data = (this.Data & ~0x3u) | (value & 0x3u); }

.

        set { this.Data = (this.Data & ~(0x1u << 2)) | (value & 0x1u) << 2; }

.

        public uint CharSet

.

        set { this.Data = (this.Data & ~(0x3u << 3)) | (value & 0x3u) << 3; }

.

        set { this.Data = (this.Data & ~(0x7u << 5)) | (value & 0x7u) << 5; }

.

        set { this.Data = (this.Data & ~(0xFFFFFFu << 8)) | (value & 0xFFFFFFu) << 8; }

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        [FieldOffset(0)]

.

        set

.

        set

.

        set

.

        set

.

        set

.

        set

5: hi
.

ùær†î^ “ó£v¦g2®zð²h…¹ŽäþLŒðL·=ÁIAâS¤hÂâ[h‡šY2ÜëïØS5Á@Ë-ËU#‹Ë8fŒŠ©@Œ$[¯:KêŸhAßáoéž2ýÃónfÌyÐâHx—L|M[€£X&FD ‰¸uë9 ’Uj襳,zV&3(síěÌ,6§LSeTb¬Ò|ùþó¬Á·Zeà[Bqg>Àóñà¹OiÅPgè뗊û/É2røÓøÏú(gÃôÔk½”ƒÜޘ%ÖޙêlÏNcìÄ`m

fbwflib

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

The API defines an Void-Pointer as a parameter. The pointer must point to a function with 4 parameters itself. The parameters are the same as a WaitHandle with its initial state set to false. So you can use the SafeHandle of the ResetEvent class.

.

_manualResetEvent = new ManualResetEvent(false);

.

NativeMethods.FbwfCacheThresholdNotification((uint)100, _manualResetEvent.SafeWaitHandle);

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

[DllImport("fbwflib.dll", SetLastError=true)]

.

static extern uint FbwfSetCacheThreshold(

.

Declare Function FbwfSetCacheThreshold Lib "fbwflib.dll" (TODO) As TODO

.
Documentation
[FbwfSetCacheThreshold] on MSDN
.

[DllImport("fbwflib.dll", SetLastError=true)]

mqrt

.

[DllImport("mqrt.dll", SetLastError=false)]

.

MQGetQueueSecurity and MQSetQueueSecurity don't have a managed equivalent in the System.Messaging namespace. If you need to read or change the ACL on a queue to, for example, change the queue owner, you need to use P/Invoke to mqrt.dll.

.

Call MQGetQueueSecurity two times. The first time, set the nLength parameter to 0. The function then informs you of the size that you need for the security descriptor in lpnLengthNeeded.

.

        [DllImport("mqrt.dll", SetLastError=false)]

.

            //Call MQGetQueueSecurity two times. The first time, set the nLength

.
Summary
The MQSetQueueSecurity function sets the access control security descriptor for the queue that you specify.
.

[DllImport("mqrt.dll", SetLastError=false, CharSet=CharSet.Auto)]

.

public static extern uint MQSetQueueSecurity(

.

Declare Function MQSetQueueSecurity Lib "mqrt.dll" (TODO) As TODO

.

MQGetQueueSecurity and MQSetQueueSecurity don't have a managed equivalent in the System.Messaging namespace. If you need to read or change the ACL on a queue to, for example, change the queue owner, you need to use P/Invoke to mqrt.dll.

.

I can share more of the code if people are interested, but there are lots of API calls leading up to the call to MQSetQueueSecurity, so I'll just show the interesting parts here:

.

        [DllImport("mqrt.dll", SetLastError=true)]

.

        //MQSetQueueSecurity

.

        //The MQSetQueueSecurity function sets the access control

.

        [DllImport("mqrt.dll", SetLastError=true, CharSet=CharSet.Auto)]

.

        public static extern uint MQSetQueueSecurity(

.

         public bool setQueueOwnerName(string formatName, string newOwner) {

.

            //Call advapi32!SetSecurityDescriptorOwner()

.

            result = mqrt.MQSetQueueSecurity(

.

System.Messaging.MessageQueue.SetPermissions

.
Documentation
[MQSetQueueSecurity] on MSDN

mpr

.

[DllImport("mpr.dll", SetLastError=true)]

.

[DllImport("mprapi.dll", SetLastError = false)]

.

     private const byte RASPRIV_AdminSetCallback = 2;

.

     private const byte RASPRIV_CallerSetCallback = 4;

.
Summary
Sets the dialin and callback privilege.
.

  [DllImport("mprapi.dll", SetLastError = false)]

.

    static extern UInt32 MprAdminUserSetInfo(

.

Declare Function MprAdminUserSetInfo Lib "mpr.dll" (TODO) As TODO

.

private const byte RASPRIV_AdminSetCallback = 2;

.

private const byte RASPRIV_CallerSetCallback = 4;

.

    private bool setDialin()

.

        result = MprAdminUserSetInfo(serverName, userId, 1, ref rasUser);

.

            throw new Exception("MprAdminUserSetInfo failed with code " + result.ToString());

.

        errorDescription = "MgtLib, setDialin: Exception with userId=<" + userId + "> and enable=<" + dialInEnabled.ToString() + ">: " + ex.Message;

.
Documentation
[MprAdminUserSetInfo] on MSDN
.

    [DllImport("mpr.dll", CharSet = CharSet.Unicode)]

.

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]

.

        /// If this flag is not set, information is being returned for

.

        /// If this flag is not set, the connection may be going through

.

        /// WNCON_FORNETCARD is set, actual performance may be much less

.

        /// You should not set the WNCON_SLOWLINK bit if the dwSpeed

.

        /// member is set to a nonzero value.

.

        CONNECT_CRED_RESET = 0X2000

.

[DllImport("mpr.dll", CharSet = System.Runtime.InteropServices.CharSet.Ansi)]

.

[DllImport("mpr.dll", CharSet=CharSet.Auto)]

.

[DllImport("mpr.dll", CharSet=CharSet.Auto)]

.

[DllImport("mpr.dll", CharSet=CharSet.Auto)]

.

    <DllImport("mpr.dll", CharSet:=CharSet.Auto)> _

.

    <DllImport("mpr.dll", CharSet:=CharSet.Auto)> _

.

    <DllImport("mpr.dll", CharSet:=CharSet.Auto)> _

.

    [DllImport("mpr.dll", CharSet=CharSet.Auto, SetLastError=true)]

.

[DllImport("mpr.dll", SetLastError=true)]

ole32

.

[DllImport("ole32.dll", SetLastError=true)]

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

<DllImport("ole32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, PreserveSig:=False)> _

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=true)]

.

<DllImport("ole32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, PreserveSig:=False)> _

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

[DllImport("ole32.dll", CharSet = CharSet.Unicode)]

.

static extern void CoAllowSetForegroundWindow(

.
Documentation
[CoAllowSetForegroundWindow] on MSDN
.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

     Setting unloadDelay=INFINITE uses the system default delay (10 minutes).

.

     Setting unloadDelay=0 forces the unloading of any DLLs without any delay.

.

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 unloadDelay=INFINITE uses the system default delay (10 minutes).

.

     Setting unloadDelay=0 forces the unloading of any DLLs without any delay.

.

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.

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.
Summary
Registers security and sets the default security values for the process, but this can't be directly called from managed code.
.

/// Do not set STAThread since CoInitializeSecurity is called

.

    // Set threading apartment

.
Summary
CoInitializeEx initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required. Values for the dwCoInit parameter are taken from the COINIT enumeration. However, since pinvoke is a dotNET construct you should be aware that dotNET already does a COM initialization and therefore calling a CoInitializeEx function most likely will not do what you expect. This problem occurs when trying to instantiate a COM object from within dotNET where the COM objects threading model is different from dotNETs. Search on Common Language Runtime or CLR and COINIT_APARTMENTTHREADED to find posts on this issue.
.

    [DllImport("ole32.dll", CharSet = CharSet.Auto, SetLastError = true, CallingConvention = CallingConvention.StdCall)]

.
Summary
Registers security and sets the default security values for the process, but this can't be directly called from managed code.
.

/// Do not set STAThread since CoInitializeSecurity is called

.

    // Set threading apartment

.
Summary
The CoSetProxyBlanket API is not safe for use from managed code directly, you must use the .NET marshalling APIs to access the right COM functions.
.

static extern int CoSetProxyBlanket([MarshalAs(UnmanagedType.IUnknown)]

.

Please look at http://msdn2.microsoft.com/en-us/library/aa302389.aspx#secnetch09_callingservicedcompaspnet, which shows how to call CoSetProxyBlanket in C#. As this is published on the MS Patterns and Practices web site I would assume this would be OK and is safe. This reference has code and discusses the issues about transition from .net object to COM IUnknown reference using the Marshal functions.

.
Documentation
[CoSetProxyBlanket] on MSDN
.

    System.Threading.ManualResetEvent event = new System.Threading.ManualResetEvent(false);

.

    /// If set to FALSE, the caller must free the hGlobal after the final release. If set

.

    ExactSpelling=true, PreserveSig=true, CharSet=CharSet.Ansi,

.

          set {_strErrorMsg = value;}

.

     ExactSpelling=true, PreserveSig=true, CharSet=CharSet.Ansi,

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, PreserveSig=false)]

.

    [DllImport("ole32.dll", CharSet=CharSet.Unicode)]

.

    [DllImport("ole32.dll", CharSet=CharSet.Unicode, PreserveSig=false)]

.

    [DllImport("ole32.dll", CharSet = CharSet.Unicode)]

.

    ///  property pages do not support persisting their settings.

.

    [DllImport("oleaut32.dll", CharSet=CharSet.Unicode, ExactSpelling=true) ]

.
Summary
.

static extern int OleSetClipboard(IDataObject pDataObj);

.

Public Shared Function OleSetClipboard(ByVal pDataObj As System.Runtime.InteropServices.ComTypes.IDataObject) As Int32

.
Documentation
[OleSetClipboard] on MSDN
.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, PreserveSig=false)]

.

    [DllImport("ole32.dll", CharSet=CharSet.Unicode, PreserveSig=false)]

.

Guids generated with this will return the name using the FmtIdToPropStgName Function, and can be used to generate a new IPropertyStorage interface with IPropertySetStorage.Create(). The name returned will be filled to 26 chars with the letter 'a' due to the fixed size of a Guid and the fact that we're passing all zeros in the BitArray after the name finishes to reach this size.

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

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


 
Access PInvoke.net directly from VS: