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

wlanapi

.

�)2z;h�*���TC�@/�)Z0�\H��F��c�� �W9�oCa����~���q�BSt���M�K��:�ZZ��:�^1� �dm>��Zj:Q�g��� `X�Y몬cU]�ݸ��M�3�\c�����C;�N؍0�qQa)��cDf�Y��A�g�S��yn75R��=�e̎����U6�\$�3�цگ� ]������C-�ږ.��H�.�(23��skU�['����Nl����G�[����$�;A��?Y׼� N���/���)�לҿm�z]�4AI�uv�L� G�i�lsf���G��=VI�G�v�<�Fs�.!�������{Mw�k5_W�t?p?�m]'����N����.�8�,�

.

߈�@ƪ���b�bO��+9��[�;-�o�᜾�������������ޥ� S�p9>���u�ahjMW� e�VI����(�aA�f�`�<�kiT��n�N`�;"�:�54jǪ��-�S���]�X&:T� N ղ��)����A6��~�T��C����� 1�n�XpDl�/����e������������ gU�Z�ں� ��H���'D�lX�7�T��:G��m�<alU�U�p����π��<���Q*"��-$�.��V/=\�{l�2jN���A�J�ug���ܧ�r�o��,v��\�!��ވ&v�Ȫ<h�(:�{�X���?���'������#e��I��h���j. l��.̗��[}'�5W�����N���!E;j�'�qS�KQ�,�Wb|��^%�X�!�\>Ǵ��d�4�Y���ai��aɛ�;h����&NIES

.

BW٤��k.XDq빏.�)�"��3�b��W�7�9�ړ���db Kȃ�"4v[MEE���0����y 4XK8��Ai�������|=Q��u����\�ZA�J��h~���$!L�-z2�q�B��b�?ܪ���e�Ơ����\��2h�ǧ�n�P��ã�}+��m�[�����3���{�8&�R ����޳j�9̓t������P�s��,�my���M�|��5�'��V[��E��R,(�wj�ZT2 ���E����o$ы^�m����t�G��/ƽc��4�I�I���Js�r:����h��� j2*�_�-R���!k��T��H��

.

�:�1Xu&c�M��2���߫& ����Ug�`�c�x�7�[⠉��D�M8�&XN�Oc̟����j�f.���N�Z�H����?�:H���(}���pICOV�s��y5�B=�%���\U��e�B�V�'2d&%uӌj.J�<>�0�����𶺻S־��Ӛ�TQ?�\k%���L�|��Ӹ�����t#�|p�p�U�l#�?�9h�Όx�\�Q�?��)��.Uқ0��ϭ���Sk/h�0,g�~ k6�s�¤� ��3��@��&,ai?�I��M�G� �O:�\j#�EV��`��C� D���%^h/� a爫��b����2��g9�L�������؃I��X�н��8��Vuz�5�ʍ�=U�.�Q��L5%Z�d$��ż�y��"�v�G�7�,�|����!͊�v�u��{�D�9�3%�jK�7�� ���?��(��"�ۀ�g'�1�߷��BJ��C49�T�����V��&��x�BDL2ܘ1oG<ø oG�4�0Yok �]��nC{O�.gʺ��L���iuQ@g�;�MX�+�0�y=�p��i�G��G�.H9�<���C ؤ����ox�e�p��zF$��T��Tp�20�> .�?�X�HF{�oWp�S��?���`O��b�9�ٟ���rq�w�������#d����V��{�̷I�%�F�RgK������!�Q� ��Covh4��ȡɷ[[엊\*ɷ$z�

.

9Lk�l��!0��%H���@��>7�:���FK(�,'v�n:�6'� |����{�����0!Nk���r�\��u����/=jZ� v�R�ӎ�4�x��6R����P�􍑭1����on��kD��NtQ��i�������D�᣻ަ�6��F�����;AI��f){��{��'���ƶ���}��0�+��>w�/���\$��5a�����٭����Hj٢���k� Nf�I7�J'LN��T�H�0�%�D���V�с�t�r��`�)H#!��:s8=�&����:��s9,t���!�Q�G9�Aiμ���7�-Ad��s��R�l�70|-�U�YD��0��

.

a)�W֫�7��[�)���\�ں͕����UȀ�JC](��1\����(�J��F���髌��&w�p�0>`�u�<�L043s6-95���w�F�j��7���F�FU�ǽ�܌q�3�QB :ؕ[���.زWw�x�o)T�~؃s\q�a�U�[(j&�����sN�$�! ��?:�'�d���������y�d'�ac�S:�p�W��k_|-v%ڷ�F�j��ނ$�`��8f(�0B������陋I\��b�m_� � �Y6��s|R�l�Pא�����{�(o�w�H�6A� h�e�z��U���mvDs�@�gR�K12V63e>�/���ѽ���h�q'���3�����)��3S5��@�����ht�I˟����2NC/"sai s��0ʾϾ,�)<&Yΰ�&��׋�H c@}�V��"����� �$��$T�UG�.��Ms=8)6�zr;�A��cXď�â�M�{�T�)69�D����m%��q}��QZsL:�w痩Y�(��=��|�L�}�߷�� �1��J����kn� ����o,�k� �b����=VG{�@pz�$����������5l��d�k5q�A��a�G� ��]RyS��@������Z����� =A�T))C�p^��V×ye�j�D;zH����p�r�㷤@.��(M�h={("X�� J�(���E�}�RW��s�� �ʙB2D���Lc�4����u�T\ĮC�<�mD8M�KI�;��#��GŖ�-���w�=�Q

.

':�]Y2�̿��F��lT�:���q�ώ���\�Ԙ�w*u�3���}�M�j�lS�J��FBœ��s�0Xŧ9������-y�f ���wq���'�Z�?AiTDoNj���d��OF���f��'�f�v�p��NB0��}�!I�E��u�Z&ɸ)�d��ZL"$i���j�MQ�2���BF��Y���&|,�wi���"���B��i��|N�r�z�$dF�Cj.݆w���v���k�yYr?#"80� 3�CYS���j���Q2��n�%[�]�n��՟��iQO�¬*�7V�!�[j��cc:=Ca"��F�R�o�/����?����<��Yޗ-ȕ�i:e0:wy�q{%˫�lg�����)�A#��ت#����ʭ �p:�#�fPӍ������?��1K�T�K�������P��O��m�}�h�|�,=���}s�~��q�%VY�K �줋��������T�k�F�� �l+%�:F(�OnNPA����'�닠= �o���C�lWF>������׋]�XüY�A��yQO��\��� �n��ܠ�����HB�ӱDK�t���F{հ

.

�D�d�.�k���;�#g�`&s�)-�f#R}D��E/<�X%�Y�$��"%J�bf�ʾ5��!z� ����a��f��ь�#�1Ǭ�=��n�{��t�������؁�4F�1v����J ��dr�[1�Y_"!@iV����e��j]e�ϔ�n�.}�F�9�����wc��D��4gT/�) ��ÂH���'��7�çT<w�C(�.�B܂���*��y��No�|����i6Fj2_����a����2<5��� ��]%!��u��IA4Z�g��J�F��@M ������[9� /[-����� 74fZ�b%JLza/7� ����s4K#�k��� H�}0&����/%��HY&4��׭w�k���[Ϙ�:>�!1w�4��,���������5-V@3:���|a#���Y]�.S��}��#~����jQ�:����q���<|p֏�b(&#Ғ=�(�J��T����k���{����ڵ��"7���d�zHk��N-��>�Or ɕ�������\v��E�0��NU��.�Ϊ�=&``����м�9��u#6� 8#��ZO��RYBM}f����>x�d�����m�cap��'���L;L��#��K(b��v�m� 4���쒦�D7��'Q.%���gW��n�%���g$��$�� �ԂK ������\�h6����_�Js>x1��k؀�7�Ai:g{z�p��`������#�6�d�;n�P�I���jg1�וo�8>�wi�4����HRNK�GX���.[�A��#$�;�J��DǼ�� ��V���R �

.

q�c���A7�ہ�CYPi��7�e�o��Ţ�H�ވ��L��l����u�K��͂d��"�Izףbk0V惇Y��)v��Vlњ'�A[x�J2]�Q�;X��#��Ѳr���/���ձ�<�y�h=�:���?��x����J��ׅ�tfX%���y�繵XhXe�y�E�˻}ȿ�.��Q/��)���x�̌��1����p�u��# �bRk0 ��Zق3��w�^�[m*�7b�f��9�'sڋ�J�nz�3����0z��!�⭄�m���gw�U���[��E�(S.q��*Xzt��j�AI� �"V

.

Y�K��e�k��������YCBaZ�R�L�GϑCIu=eL:���$G.��rV���W�x�S��p���u�W~3Dj7w G����N�SE��6p�Z ��c+��SX�w2��M� ��jkݯ���EW.c"��\�;�� �c���Z�2pc'�dE��P+�{��7��O�I�Cy�*� ��' �j�W��X��dAI�~ ;�2�v���Ho�u4����� &{��fC²>JBX>����u��Q]�-H��)٫��U�� ���'%J'ne���z��?m�]�XI���\�:Kg�������tS���@�V��c�F¸#�h�Zצ�J���R�|8��@�U�a�X���<�f��A9R0~R��p��O�ް� ��C����d��kH�h9u��D]�u3-!ڑ�?[�d��;��rA{���@S��: �I��'�߼����ЭA�ܤX��7k?���{�'g��Mqk8�

.

�8�Z`r��%ONF��ʶ��oh�@cw����K��[jT?�����jF.A/WSV��uBb�a�X\?3 �P���������.�j��Ȩ�� F'���Da]�8?�5�h6p8T�|Y���Y��6nj�Dɱ�|<�ɬi���*%�&��s�?�� �h���2�X�g��2�.�2Gagj�P�z�$���<(:C�ٛ�Cd~Un=¶������!h�F���(۝��)�����gtc(Tb�8(��ZSԐ�jf@����L�BJ����/��C�P��M�2o�V �\ y �[z���:���=,Uj����la�#b���t����M��Q�L91`�v?O��b��:����� �B�8b�G��,$h�N�ZH:�ҙ�AlTD$���� �5}�Y�Ш�����AI�K����{���$�>����]u�bIY�Y��Ci�G�KL�W��b�^8�C����Ѷ��J<��,�Q��.~5���"���@bKH�/��<ׁ���L{ '��cG�'/�69A����� u�@TIA�"sj

.

&����r6AJ�X\��ʕy��]�pP�]�$�2aI�I�h��}$��l(z|������/��*-.�D���Q>�

.

public static extern uint WlanGetAvailableNetworkList(IntPtr hClientHandle, ref Guid pInterfaceGuid, uint dwFlags, IntPtr pReserved, ref IntPtr ppAvailableNetworkList);

.

     Public Shared Function WlanGetAvailableNetworkList(ByVal hClientHandle As IntPtr, ByRef pInterfaceGuid As Guid, ByVal dwFlags As UInteger, ByVal pReserved As IntPtr, ByRef ppAvailableNetworkList As IntPtr) As UInteger

.

private const uint WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_ADHOC_PROFILES = 0x00000001;

.

private const uint WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES = 0x00000002;

.

WLAN_AVAILABLE_NETWORK_LIST

.

IntPtr ppAvailableNetworkList = new IntPtr();

.

WlanGetAvailableNetworkList(ClientHandle, ref pInterfaceGuid, WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES, new  IntPtr(), ref  ppAvailableNetworkList);

.

WLAN_AVAILABLE_NETWORK_LIST wlanAvailableNetworkList = new WLAN_AVAILABLE_NETWORK_LIST(ppAvailableNetworkList);

.

WlanFreeMemory(ppAvailableNetworkList);

.

    for (int j = 0; j < wlanAvailableNetworkList .dwNumberOfItems; j++)

.

    Interop.WLAN_AVAILABLE_NETWORK network = wlanAvailableNetworkList.wlanAvailableNetwork[j];

.

    Console.WriteLine("Available Network: ");

.
Documentation
[WlanGetAvailableNetworkList] on MSDN
.

     [Out] out WLAN_HOSTED_NETWORK_REASON pFailReason,

.

     [Out] out WLAN_HOSTED_NETWORK_REASON pFailReason,

.

     [Out] out WLAN_HOSTED_NETWORK_REASON pFailReason,

.

     [Out] out WLAN_HOSTED_NETWORK_REASON pFailReason,

.

     [Out] out WLAN_HOSTED_NETWORK_REASON pFailReason,

.

     [Out] out WLAN_HOSTED_NETWORK_REASON pFailReason,

.

     [Out] out WLAN_HOSTED_NETWORK_REASON pFailReason,

.

Public Shared Function WlanHostedNetwrokStartUsing(hClientHandle As IntPtr, <Out> pFailReason As WLAN_HOSTED_NETWORK_REASON, pReserved As IntPtr) As UInteger

.

     [Out] out WLAN_HOSTED_NETWORK_REASON pFailReason,

.

There is a managed WiFi API available on codeplex http://managedwifi.codeplex.com/

.

WLAN_AUTH_CIPHER_PAIR_LIST

.

This method just tells the interface to start doing a scan. If you want to get results as they come back, you have to register a callback function. An easier way is to call this method, wait a while, then use WlanGetAvailableNetworkList

.
Summary
The WLAN_STATISTICS structure contains assorted statistics about an interface.
.

            public ulong ullFourWayHandshakeFailures;

.

            Public ullFourWayHandshakeFailures As ULong

.
Import
credui,advapi32,gdi32,kernel32,ole32,shell32,user32,glossary,coredll,rasapi32,mpr,netapi32,uxtheme,avifil32,aygshell,winscard,crypt32,secur32,wtsapi32,shlwapi,winspool,oleacc,rapi,oleaut32,winfax,odbc32,msi,cards,powrprof,urlmon,xolehlp,twain_32,winmm,wininet,comdlg32,imm32,ntdsapi,odbccp32,Constants,Delegates,Enums,Interfaces,Structures

kernel32

.

    static void Main(string[] args)

.

            MsgBox(String.Format("Failed to attach console with error: {0}", Marshal.GetLastWin32Error()))

.
  • Returns True if the attachment succeeded or False if attachment failed. Use GetLastWin32Error to get the error code (see below sample).
.

To duplicate the 'Console Application' feel, you can use the below code and call AllocateConsole as soon as Main() is called. This will cause it to act just as a console application would normally. Except you have the freedom to not show the console window at all if you don't want to (ie, if you have a /SHOWGUI option, which you prefer never creates a console in the first place).

.

    ///  USAGE: Place inside your program's main static class

.

    /// If the function fails, the return value is zero.

.

    /// If the function fails, the return value is zero.

.

    /// If the function fails, the return value is zero.

.

    /// always pass this with AttachConsole in .NET for stability reasons and mainly because

.

    /// attaches itself to it if available.

.

            throw new Exception("Console Allocation Failed");

.
  • Returns True if the attachment succeeded or False if attachment failed. Use GetLastWin32Error to get the error code (see below sample).
.

To duplicate the 'Console Application' feel, you can use the below code and call AllocateConsole as soon as Main() is called. This will cause it to act just as a console application would normally. Except you have the freedom to not show the console window at all if you don't want to (ie, if you have a /SHOWGUI option, which you prefer never creates a console in the first place).

.

    ///  USAGE: Place inside your program's main static class

.

    /// If the function fails, the return value is zero.

.

    /// If the function fails, the return value is zero.

.

    /// If the function fails, the return value is zero.

.

    /// always pass this with AttachConsole in .NET for stability reasons and mainly because

.

    /// attaches itself to it if available.

.

            throw new Exception("Console Allocation Failed");

.

                  [ mailto:Gabriel@paradisim.net ]

.

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

.
  • WaitForDebugEvent
.

Can someone explain why "[return: MarshalAs(UnmanagedType.Bool)]" is part of the signature?

.

        COPY_FILE_FAIL_IF_EXISTS = 0x00000001,

.

        COPY_FILE_FAIL_IF_EXISTS = &H1

.

        If filePath.Contains("\") Then

.

        CopyFileEx(sourcePath, destPath, New CopyProgressRoutine(AddressOf CopyProgressHandler), IntPtr.Zero, pbCancel, CopyFileFlags.COPY_FILE_FAIL_IF_EXISTS)

.

        COPY_FILE_FAIL_IF_EXISTS = 0x00000001,

.

        COPY_FILE_FAIL_IF_EXISTS = &H1

.

        If filePath.Contains("\") Then

.

        CopyFileEx(sourcePath, destPath, New CopyProgressRoutine(AddressOf CopyProgressHandler), IntPtr.Zero, pbCancel, CopyFileFlags.COPY_FILE_FAIL_IF_EXISTS)

.

    static void Main(string[] args)

.

Mais si ya des notes !!!

.

The following class object provides some interprocess event signaling style synchronization within the .NET environment. Specifically, using named events, processes can signal each other out of an effecient wait. This reach goes beyond .NET can allow .NET and Win32 processes to signal each other. There are some security issues, in that the default security context of the process is used.

.

NOTE: This class needs some changes. The CloseHandle call will destroy the event when the last handle is closed. This makes it hard for one application to "lock" the event while making another wait on it since this class is always closing the handle. An alternative that I found to work is to have the CreateEvent call in the constructor and implement IDisposable by moving the CloseHandle call to the Dispose method.

.

    /// The NamedEvent class object provides the ability to wait on, pulse, set, and

.

    /// The static methods require a name, where as the instance methods contain the

.

    /// The wait methods will wait on a single object, the named event, only. There

.

    internal static extern Int32 WaitForSingleObject(IntPtr handle, Int32 milliseconds);

.

    /// Wait for the event to signal to a maximum period of TimeoutInSecs total seconds.

.

    public bool Wait( int TimeoutInSecs )

.

        int rc = WaitForSingleObject( _Handle, TimeoutInSecs * 1000 );

.

    /// Pulse the named event, which results in a single waiting thread to exit the Wait method.

.

    /// Set the named event to a signaled state. The Wait() method will not block any

.

    /// Reset the named event to a non signaled state. The Wait() method will block

.

    /// Wait for the event with the given name to signal to a maximum period of TimeoutInSecs total seconds.

.

    static public bool Wait( int TimeoutInSecs, string Name )

.

        return (new NamedEvent(Name)).Wait( TimeoutInSecs );

.

    /// Pulse the event with the given name, which results in a single waiting thread to exit the Wait method.

.

    /// Set the event with the given name to a signaled state. The Wait() method will not block

.

    /// Reset the event with the given name to a non signaled state. The Wait() method will block

.

I think that in .NET 2.0 the System.Threading.EventWaitHandle class does the same that the example.

.

    /// By SHG at mail@Toolsbox.dk

.

    /// By SHG at mail@Toolsbox.dk

.

    static void Main(string[] args)

.
Summary
.

static extern IntPtr CreateMailslot(string lpName, uint nMaxMessageSize,

.

Declare Function CreateMailslot Lib "kernel32.dll" _

.
Documentation
[CreateMailslot] on MSDN
.

//// frmMain.cs ///////////////////////////////

.

    public class frmMain : System.Windows.Forms.Form

.

        private static frmMain        form = null;

.

        /// Main entry point for the application.

.

        public static void Main()

.

                // of the main form.

.

                {    // CreateMutex() failed.

.

                    // once the app is up and running, I log the failure from

.

                    // within the frmMain constructor.

.

                    m_bMutexFailed = true;

.

                // construct the main form object and

.

                form = new frmMain();

.

                // cleanup the main form object instance.

.

                        throw new MutexCreationException( string.Format( "Failed to initialize security descriptor. Win32 error num: '{0}'", lastError ) );

.

                        throw new MutexCreationException( string.Format( "Failed to set security descriptor DACL. Win32 error num: '{0}'", lastError ) );

.

        //One of the following wait modes can be specified. Different instances of the same pipe can specify different wait modes.

.

        PIPE_WAIT = 0x00000000,

.

        PIPE_NOWAIT = 0x00000001,

.

    /// of implementing named pipe support in .Net.   (If you doubt this, try it the hard way... we'll wait.)

.

    ///         3. Call DataAvailable() in a loop with Read(), Write, ReadLine(), etc. until IsConnected turns false.

.

    ///         4. Call Listen() again to wait for the next client.

.

    ///         2. Call DataAvailable(), Read(), Write(), etc. until you're done,

.

        ref uint bytesAvail, ref uint BytesLeftThisMessage);

.

    private const uint PIPE_WAIT = 0x00000000;

.

    private const uint PIPE_NOWAIT = 0x00000001;

.

    /// Waits indefinitely when connecting to a pipe.

.

    private const uint NMPWAIT_WAIT_FOREVER = 0xffffffff;

.

    /// Does not wait for the named pipe.

.

    private const uint NMPWAIT_NOWAIT = 0x00000001;

.

    private const uint NMPWAIT_USE_DEFAULT_WAIT = 0x00000000;

.

            string.Format("NamedPipeStream.Open failed, win32 error code {0}, pipename '{1}' ",err,pipename));

.

            PIPE_TYPE_BYTE | PIPE_WAIT,

.

            NMPWAIT_WAIT_FOREVER,

.

    public bool DataAvailable

.

        uint bytesRead = 0, avail = 0, thismsg = 0;

.

            null, 0, ref bytesRead, ref avail, ref thismsg);

.

        return (result == true && avail > 0);

.

        throw new Win32Exception(Marshal.GetLastWin32Error(), "ReadFile failed");

.

        throw new ArgumentException("Buffer does not contain amount of requested data", "buffer");

.

        throw new Win32Exception(err,"Writing to the stream failed");

.

    public static void Main(string[] args)

.

            while (stream.DataAvailable)

.

            if (stream.DataAvailable)

.

This is great for starting an external app and then using the PID and handle for calls to functions such as WaitForSingleObject and all window message functions.

.

The unmanaged prototype contains a return directive because the CreateSymbolicLink API function returns BOOLEAN, a one-byte data type. The default marshaling for bool is four bytes (to allow seamless integration with BOOL return values). If you were to use the default marshaling for BOOLEAN values, it's likely that you will get erroneous results. The return directive forces PInvoke to marshal just one byte of the return value. Source: http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=762&ns=16196

.

   IntPtr TimerQueue, WaitOrTimerDelegate Callback, IntPtr Parameter,

.

Private Shared Function CreateTimerQueueTimer(ByRef phNewTimer As IntPtr, TimerQueue As IntPtr, Callback As WaitOrTimerDelegate, Parameter As IntPtr, DueTime As UInteger, Period As UInteger, _

.

public delegate void WaitOrTimerDelegate (IntPtr lpParameter, bool TimerOrWaitFired);

.

    /// The callback function is queued as an APC. It should not perform alertable wait operations.

.

    /// The callback function is queued to an I/O worker thread. This flag should be used if the function should be executed in a thread that waits in an alertable state.

.

    /// The callback function is queued as an APC. Be sure to address reentrancy issues if the function performs an alertable wait operation.

.

    /// The callback function can perform a long wait. This flag helps the system to decide if it should create a new thread.

.

   IntPtr TimerQueue, WaitOrTimerDelegate Callback, IntPtr Parameter,

.

public delegate void WaitOrTimerDelegate (IntPtr lpParameter, bool TimerOrWaitFired);

.

    /// The callback function is queued as an APC. It should not perform alertable wait operations.

.

    /// The callback function is queued to an I/O worker thread. This flag should be used if the function should be executed in a thread that waits in an alertable state.

.

    /// The callback function is queued as an APC. Be sure to address reentrancy issues if the function performs an alertable wait operation.

.

    /// The callback function can perform a long wait. This flag helps the system to decide if it should create a new thread.

.

        throw new ApplicationException(string.Format("Failed with win32 error code {0}", Marshal.GetLastWin32Error()));

.

    static void Main()

.
Summary
.

static extern IntPtr CreateWaitableTimer(IntPtr lpTimerAttributes, bool bManualReset, string lpTimerName);

.

public static extern IntPtr CreateWaitableTimer(IntPtr lpTimerAttributes, bool bManualReset,

.

public static extern bool SetWaitableTimer(IntPtr hTimer, [In] ref long pDueTime,

.

public static extern Int32 WaitForSingleObject(IntPtr handle, int milliseconds);

.

The main code is :

.

     handle = Win32.PowerManagement.CreateWaitableTimer(IntPtr.Zero, true, "");

.

     Win32.PowerManagement.SetWaitableTimer(handle, ref duetime, 0, null, IntPtr.Zero, true);

.

     int ret = Win32.PowerManagement.WaitForSingleObject(handle, (int)Win32.PowerManagement.INFINITE);

.

     MessageBox.Show("Wait object"); // ret = 0x00000000L here

.
Documentation
[CreateWaitableTimer] on MSDN
.

     Console.WriteLine("Failed to delete '{1}': error={0}", lastError, filePath);

.

lpOverlapped - Main use in asynchronous deviceIoControl. NativeOverlapped is the managed version of the structure and use is the same. The difference between NativeOverlapped and Overlapped is managed Struct vs managed Class respectively. NativeOverlapped was more condusive for one-way device driver communication. Convert from Overlapped to NativeOverlapped to make the call, since NativeOverlapped is explicitly defined to mimic the unmanaged Overlapped structure.

.

This is great for interacting with devices; now perhaps someone can help with the SetupDi calls to actually discover the device handles, etc...? If you are able to conquer it (I wasn't) toss me a mail at dotnet at richardgoodwin dot com

.

     Throw New InvalidOperationException("Get Card ID fails. Errorcode: " & _

.

    // Call to PLX card to attach wait event to an Interrupts

.

    Mailslot            = 0x0000000c,

.

     StoragePredictFailure = (EFileDevice.MassStorage << 16) | (0x0440 << 2) | EMethod.Buffered | (0 << 14),

.

    /// The overlapped event wait handle.

.

    /// Set the overlapped wait handle and clear out the rest of the structure.

.

  deviceIoOverlapped.ClearAndSetEvent(hEvent.SafeWaitHandle.DangerousGetHandle());

.

       PRE_FAILURE_WARRANTY = &H1

.

Returns ERROR_SUCCESS on success or an error code on failure. Unless only the primary computer name is requested, the buffer will be filled with a series of null-terminated strings followed by a final null terminator. To measure the required number of characters, not including the final null terminator, use a null buffer and a zero size. This function is similar to GetComputerNameEx, and delegates to it to obtain the primary computer name.

.

    static void Main(string[] args)

.

    /// The main entry point for the application.

.

    static void Main(string[] args)

.

    Debug.WriteLine(string.Format("EnumSystemCodePages failed with errno = {0}", errno));

.

    Debug.WriteLine(string.Format("ERROR: Failed to get encoding for '{0}'\n{1}", codePageString, err.Message));

.

    LOCALE_SPECIFICDATA     = 0x00000020, // Locales that contain language and region data

.

    static void Main()

.

    LOCALE_SPECIFICDATA     = 0x00000020, // Locales that contain language and region data

.

    LOCALE_SPECIFICDATA     = 0x00000020, // Locales that contain language and region data

.

    static void Main()

.

    LOCALE_SPECIFICDATA     = 0x00000020, // Locales that contain language and region data

.

This API is dangerous and you should avoid using it. See MSDN docs for details.

.

By setting the SetLastError property to true, a System.ComponentModel.Win32Exception will generated if the function fails.

.

this function is contained in "coredll.dll" not "kernel32.dll"

.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/obtaining_directory_change_notifications.asp (dead link)

.

Those 'int32's are IntPtr - and using an Int32 instead will fail on a 64-bit platform.

.

The FileInfo() class provides managed access to this information. As with all .NET file handling (as of framework 4) it is constrained in terms of the length of filename allowed.

.

Those 'int32's are IntPtr - and using an Int32 insteade will fail on a 64-bit platform.

.

The FileInfo() class provides managed access to this information. As with all .NET file handling (as of framework 4) it is constrained in terms of the length of filename allowed.

.

    //throw an error if the input buffer is not obtained

.

   if (sProcessName.ToLower().Contains("wwahost")

.

                Get-ChildItem | where { !$_.PsIsContainer } | Get-BinaryType

.

                    Write-Error "Failed to get binary type for file $($Item.FullName)"

.

The original GetCommandLine function returns a pointer to a buffer allocated and owned by the operating system. When marshaling strings as return types, the interop marshaler assumes it must free the memory that the original LPTSTR type pointed to by the function. To prevent the marshaler from automatically reclaiming this memory, the managed GetCommandLine prototype returns an IntPtr type instead of a string. The Marshal.PtrToStringAuto method copies the unmanaged LPSTR type to a managed string object, widening the character format, if required.

.

Use this API function when you need access to raw command line string and not already parsed arguments in Main(string[] args)

.

The code below correctly obtains the compressed file size also if above 4GB. (Fixed VB and C# code, 2012 Eske Rahn)

.

The ManagedWindowsApi project (http://mwinapi.sourceforge.net) provides an ExtendedFileInfo class that contains utility methods for file information.

.

        ComputerNameDnsDomain,

.

        ComputerNamePhysicalDnsDomain,

.

    static void Main(string[] args)

.

        success = GetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNameDnsDomain, name, ref size);

.

        ComputerNameDnsDomain,

.

        ComputerNamePhysicalDnsDomain,

.

    static void Main(string[] args)

.

        success = GetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNameDnsDomain, name, ref size);

.

      //Need to use reflection to obtain pointer to the console output buffer

.

       //Obtain the current console font index

.

       //Use that index to obtain font size    

.

   Console.WriteLine("Failed to get initial working directory; error = '{0}'", lastError);

.

   Console.WriteLine("Failed to get initial working directory; allocated buffer is shorter than required: '{0}'<'{1}'", MAX_DEEP_PATH, folderNameLength);

.

  System.AppDomain.GetCurrentThreadId() (This is deprecated in .NET 2.0)

.

    static void Main(string[] args) {

.
Summary
Retrieves information about the amount of space available on a disk volume.
.

   out ulong lpFreeBytesAvailable,

.

ulong FreeBytesAvailable;

.

bool success = GetDiskFreeSpaceEx("C:\\", out FreeBytesAvailable, out TotalNumberOfBytes,

.

Console.WriteLine("Free Bytes Available:      {0,15:D}", FreeBytesAvailable);

.

The call is also available via coredll.dll on CE devices:

.

   out ulong lpFreeBytesAvailable,

.

/// if the value could not be obtained</param>

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


 
Access PInvoke.net directly from VS: