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

netapi32

.

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

.

Declare Function DsAddressToSiteNames Lib "netapi32.dll" (TODO) As TODO

.

           throw new Win32Exception(result);

.

            throw new Win32Exception(result);

.

[DllImport("Netapi32.dll", CallingConvention=CallingConvention.Winapi, SetLastError=true, CharSet=CharSet.Auto)]

.

Declare Function DsEnumerateDomainTrusts Lib "netapi32.dll" (TODO) As TODO

.

     [DllImport("Netapi32.dll", CallingConvention=CallingConvention.Winapi, SetLastError=true, CharSet=CharSet.Auto)]

.

     [DllImport("Netapi32.dll",EntryPoint="NetApiBufferFree")]

.

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

.

Declare Function DsGetDcClose Lib "netapi32.dll" (TODO) As TODO

.

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

.

Declare Function DsGetDcName Lib "netapi32.dll" (TODO) As TODO

.

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

.

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

.

     throw new Win32Exception(val);

.

using DWORD = System.UInt32;

.

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

.

[DllImport("Netapi32.dll", EntryPoint = "DsGetDcNextW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]

.

Declare Function DsGetDcNext Lib "netapi32.dll" (TODO) As TODO

.

         throw new Win32Exception(); //internally calls GetLastWin32Error()

.

     if (!Win32.IsNullHandle(pDnsHostName)) //pNnsHostName != IntPtr.Zero;

.

using DWORD = System.UInt32;

.

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

.

[DllImport("Netapi32.dll", EntryPoint = "DsGetDcOpenW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]

.

Declare Function DsGetDcOpen Lib "netapi32.dll" (TODO) As TODO

.

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

.

internal static extern System.Int32 DsGetDcSiteCoverage(

.

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

.

static extern UInt32 DsGetSiteName([MarshalAs(UnmanagedType.LPTStr)]string ComputerName, out IntPtr SiteNameBuffer);

.

    <DllImport("NetApi32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _

.

    <Out()> ByRef SiteNameBuffer As IntPtr) As UInt32

.

UInt32 result = DsGetSiteName(ComputerName, out pBuffer);

.

    Dim result As UInt32 = DsGetSiteName("MEASUS", pBuffer)

.

[DllImport("netapi32.dll")]

.

Declare Function DsRoleFreeMemory Lib "netapi32.dll" (TODO) As TODO

.

    /// <returns>Win32 error code.</returns>

.

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

.

Declare Function DsRoleGetPrimaryDomainInformation Lib "netapi32.dll" (TODO) As TODO

.

    /// <exception cref="Win32Exception">Thrown when the domain information cannot be retrieved.</exception>

.

    /// <exception cref="Win32Exception">Thrown when the domain information cannot be retrieved.</exception>

.

    /// <exception cref="Win32Exception">Thrown when the domain information cannot be retrieved.</exception>

.

    /// <exception cref="Win32Exception">Thrown when the domain information cannot be retrieved.</exception>

.

    /// <exception cref="Win32Exception">Thrown when the domain information cannot be retrieved.</exception>

.

    /// <exception cref="Win32Exception">Thrown when the domain information cannot be retrieved.</exception>

.

    /// <exception cref="Win32Exception">Thrown when the domain information cannot be retrieved.</exception>

.

        int lastWin32Error = DsRoleGetPrimaryDomainInformation(server, infoLevel, out buffer);

.

        if (lastWin32Error != 0)

.

            throw new Win32Exception(lastWin32Error);

.

��8U5DJ7��y7�޾Z�r%�32n.0�x�[����X� f���vqev[��A�כ�bf���tFh�7��bW8E��)�| ����F���f����\�J�K�ܬY{ :��c�@���51�Ip�K���@�%��a}5��4�6�S�1��w�N5���JM�G�w8��<:�5|��B�DK>(LP�Rҽ�`����]��m2HZ&戓�H��%"}�J��z��Ʃ�cr"W�H��Y�k�﹄��v�נ�����q��h#x��A�i� Wk�k���J���yW�s�;U�ϧPh/��/ŕ�o�e2ώ�q�������g B���O���H �lk�5����}?��Ѵ=鏔��6���� C����D<���9�gr�Rx(���ޕ��Wi4׸��Ug��ٓ��[��%{�Ў۳䫯�No2a���-t���٢&�U�N��?�46�{�����/DPhJ� ���A)�uRL��p6u5���w��kh������n�Bz'��q��z"V��WA��ّ�r�L���� W����'ĩ�/7܁��|R�5�\������� ctBu��#Z�U��(���6�7���c���U5*�aӤh��Ō��p�g60e,E���u�T��t!�2��-��Gs�� }f���Y�:�r�7�B��,�:��y���&z�QPZԤ���JG�=:׍�扻��<�"�A8��ö�ڦ�Y^;�Uv�.66�$:°8����AF?N�ObI��3V��1��Bh�pCqt�}o�v�MWrV&d����hQ��1�F>egܭ c�ެ[���f~�ꤥ?�3r�Z��ZS�}�x�"%�� �/x2�h�lG�����3f��E ��Cs{ ��>��6p��f���}ꇬB H%G��.L;���۔Q6/Jș��.w0���

.

�%h�̊�|��G4N�o�4��dCB���ar�K�5�5�LJ�4(H̄���:�6�2v�ZP&hq����E;E�ޛ:� `���ۦM��o�B�ĜW��n������z?�t�ϖfƅ?5� ��� ՜7/"�C��,���)�)f5�<��}��Kwa��% U����a��#�1H0�g�:\h�;�E}t�X�=������3ME��)&�8��������C(d��g'~�Ǻ�YUV@순�plz��gǏH�]e�t�Fw�B�u$ر�ߵ�/B���W�<C�妢Jwz�bPDRق:/!�bFL(�Ē�{�R}:�����Zc0�9i�|����B>���[���h�q��x�mNxػ�o'��32��d���R��SJv��C(��γ��z�C'�� ��=l*`��0��^

.

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

.

Declare Function LsaQueryInformationPolicy Lib "Advapi32.dll" (ByVal PolicyHandle As IntPtr, ByVal InformationClass As UInteger, ByRef Buffer As IntPtr) As UInteger

.

        err = Marshal.GetLastWin32Error();

.

            err = Marshal.GetLastWin32Error();

.

         public Int32 MaximumAuditEventCount;

.

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

.

Declare Function NetApiBufferAllocate Lib "netapi32.dll" (TODO) As TODO

.

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

.

Declare Unicode Function NetApiBufferFree Lib "netapi32.dll" _

.

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

.

Declare Function NetDfsAdd Lib "NETAPI32.DLL" (ByVal DfsEntryPath As String, ByVal ServerName As String, ByVal ShareName As String, ByVal Comment As String, ByVal Flags As Long) As Long

.

Declare Function NetDfsAdd Lib "NETAPI32.DLL" (<Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.LPWStr)> ByVal DfsEntryPath As String, <Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.LPWStr)> ByVal ServerName As String, <Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.LPWStr)> ByVal ShareName As String, <Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.LPWStr)> ByVal Comment As String, ByVal Flags As Uint32) As Long

.

I had a mapping error using the flag as a long. A DWORD is a unsigned 32 bit int. I modified this to match.

.

    [DllImport("Netapi32.dll", CharSet = CharSet.Auto/*, SetLastError=true //Return value (NET_API_STATUS) contains error */)]

.

    <DllImport("Netapi32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _

.

        Dim State As UInt32

.

        Dim NumberOfStorages As UInt32

.

    UInt32 State;

.

    UInt32 NumberOfStorages;

.

[DllImport("Netapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)]

.

Declare Function NetDfsGetClientInfo  Lib "netapi32.dll" (TODO) As TODO

.

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

.

Declare Function NetDfsGetClientInfo Lib "netapi32.dll" (TODO) As TODO

.

[DllImport("Netapi32.dll", CharSet=CharSet.Unicode/*, SetLastError=true //Return value (NET_API_STATUS) contains error */)]

.

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

.

    Dim State As UInt32

.

    Dim NumberOfStorages As UInt32

.

    Dim state As Int32

.

Declare Unicode Function NetDfsGetInfo Lib "NETAPI32.DLL" (ByVal DfsEntryPath As String, ByVal ServerName As String, ByVal ShareName As String, ByVal Level As Integer, ByRef Buffer As IntPtr) As Integer

.

    Public State As Int32

.

    Public NumberOfStorages As Int32

.

    Public storage As Int32

.

    /// <param name="Path">The current Win32 path for a Dfs link. The link path should include the Dfs root; for example, '\\MyServer\public\old\link'. </param>

.

    /// <param name="NewPath">The new Win32 path for a Dfs link. The link path should include the Dfs root; for example, '\\MyServer\public\new\link'. </param>

.

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

.

    '/ <param name="Path">The current Win32 path for a Dfs link. The link path should include the Dfs root; for example, '\\MyServer\public\old\link'. </param>

.

    '/ <param name="NewPath">The new Win32 path for a Dfs link. The link path should include the Dfs root; for example, '\\MyServer\public\new\link'. </param>

.

    <DllImport("Netapi32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _

.

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

.

    Declare Function NetDfsRemove Lib "NETAPI32.DLL" (<Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.LPWStr)> _

.

    [DllImport("Netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]

.

Declare Function NetDfsSetInfo Lib "netapi32.dll" (TODO) As TODO

.

                throw new Win32Exception(result);

.

[DllImport("netapi32.dll", SetLastError=true, CharSet = CharSet.Unicode)]

.

Declare Unicode Function NetFileClose Lib "netapi32.dll"  _

.

[DllImport("netapi32.dll", SetLastError=true, CharSet=CharSet.Unicode)]

.

Declare Unicode Function NetFileEnum Lib "netapi32.dll" ( _

.

        IntPtr iPtr = new IntPtr(pBuffer.ToInt32() + (dwIndex * Marshal.SizeOf(pCurrent)));            

.

        iPtr = New IntPtr(pBuffer.ToInt32 + (dwIndex * Marshal.SizeOf(pCurrent)))

.

[DllImport("Netapi32.dll")]

.

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

.

  <DllImport("Netapi32.dll")> _

.

  <DllImport("Netapi32.dll", CharSet:=CharSet.Unicode)> _

.

[DllImport("Netapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)]

.

Private Declare Unicode Function NetGetJoinInformation Lib "Netapi32.dll" ( _

.

// Win32 Result Code Constant

.

[DllImport("Netapi32.dll")]

.

    Private Declare Unicode Function NetGetJoinInformation Lib "Netapi32.dll" ( _

.

    Private Declare Function NetApiBufferFree Lib "Netapi32.dll" _

.

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

.

    private static extern Int32 NetGroupAdd(

.

    UInt32 level,    //info level

.

    out Int32 parm_err     //Parameter error index

.

Public Declare Function NetGroupAdd Lib "netapi32.dll" (ServerName As Any ByVal level As Long, Buffer As GroupInfo1, ParmError As Long) As Long

.

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

.

Declare Unicode Function NetJoinDomain Lib "Netapi32.dll" _

.

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

.

        [DllImport("Netapi32.dll")]

.

Declare Function NetlGroupEnum Lib "netapi32.dll" (TODO) As TODO

.

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

.

private static extern Int32 NetLocalGroupAddMembers(

.

    UInt32 level, //info level

.

    UInt32 totalentries //number of entries

.

Declare Function NetLocalGroupAddMembers Lib "netapi32.dll" (TODO) As TODO

.

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

.

    [DllImport("netapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]

.

    private static class Win32ErrorCodes

.

        byte[] baSid = new byte[] { 1, 2, 0, 0, 0, 0, 0, 5, 32, 0, 0, 0, 32, 2 };

.

            if (result == Win32ErrorCodes.NERR_Success || result == Win32ErrorCodes.MemberInAlias)

.

            throw new Win32Exception(result);

.

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

.

    static extern Int32 NetLocalGroupDelMembers(

.

        UInt32 level,

.

        UInt32 totalentries

.

Declare Function NetLocalGroupDelMembers Lib "netapi32.dll" (TODO) As TODO

.

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

.

        internal static class Win32ErrorCodes

.

            byte[] baSid = new byte[] { 1, 2, 0, 0, 0, 0, 0, 5, 32, 0, 0, 0, 32, 2 };

.

                if (result == Win32ErrorCodes.NERR_Success || result == Win32ErrorCodes.MemberNotInAlias)

.

                throw new Win32Exception(result);

.

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

.

    static extern Int32 NetLocalGroupDelMembers(

.

        UInt32 level,

.

        UInt32 totalentries

.

Declare Function NetLocalGroupDelMembers Lib "netapi32.dll" (TODO) As TODO

.

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

.

            byte[] baSid = new byte[] { 1, 2, 0, 0, 0, 0, 0, 5, 32, 0, 0, 0, 32, 2 };

.

[DllImport("Netapi32.dll")]

.

Declare Function NetLocalGroupEnum Lib "netapi32.dll" (TODO) As TODO

.

        [DllImport("Netapi32.dll")]

.

        [DllImport("Netapi32.dll")]

.

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

.

Declare Function NetLocalGroupGetMembers Lib "netapi32.dll" (TODO) As TODO

.

[DllImport("netapi32.dll")]

.

    Public Declare Function NetMessageBufferSend Lib "netapi32.dll" _

.

    [DllImport("netapi32.dll")]

.

    [DllImport("Netapi32.dll")]

.

    Declare Function NetQueryDisplayInformation Lib "Netapi32.dll"

.

    Declare Function NetQueryDisplayInformation Lib "Netapi32.dll" _

.

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

.

    [DllImport("Netapi32.dll")]    static extern int NetQueryDisplayInformation([MarshalAs(UnmanagedType.LPWStr)] string serverName,

.

    [DllImport("netapi32.dll", CharSet=CharSet.Auto, SetLastError=true)] private static extern int NetApiBufferFree (System.IntPtr pBuffer);

.

    [DllImport("Netapi32.dll", EntryPoint = "NetRemoteComputerSupports", CharSet = CharSet.Unicode)]

.

    private static extern  Int32 NetRemoteComputerSupports(String uncServerName, NetSupportOption optionsWanted,ref NetSupportOption optionsSupported);

.

Declare Unicode Function NetRemoteComputerSupports Lib "Netapi32.dll" ( _

.

     Local = 32

.

    Local = 32,

.

    [DllImport("Netapi32.dll", EntryPoint = "NetRemoteComputerSupports", CharSet = CharSet.Unicode)]

.

    private static extern  Int32 NetRemoteComputerSupports(String uncServerName, NetSupportOption optionsWanted,ref NetSupportOption optionsSupported);

.

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

.

     <DllImport("netapi32", CharSet:=CharSet.Unicode)> Function NetRemoteTOD( _

.

        [DllImport( "netapi32.dll" , EntryPoint="NetRemoteTOD",  SetLastError=true,

.

        [DllImport( "netapi32.dll")] private static extern void NetApiBufferFree(IntPtr bufptr);

.

            if ( pintError > 0 ) { throw new System.ComponentModel.Win32Exception ( pintError ); }

.

    [DllImport("netapi32.dll", SetLastError=true, CharSet = CharSet.Unicode)]

.

     Declare Function NetRenameMachineInDomain Lib "netapi32.dll" (TODO) As TODO

.

1326 - ERROR_LOGON_FAILURE

.

    [DllImport("netapi32.dll", SetLastError=true, CharSet = CharSet.Unicode)]

.

    [DllImport("Netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]

.

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

.

[DllImport("netapi32.dll",EntryPoint="NetServerEnum")]

.

[DllImport("netapi32.dll",EntryPoint="NetApiBufferFree")]

.

Private Declare Unicode Function NetServerEnum Lib "netapi32" _

.

namespace Microsoft.Win32

.

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

.

        [DllImport("Netapi32", SetLastError = true), SuppressUnmanagedCodeSecurityAttribute]

.

                throw new System.ComponentModel.Win32Exception(ret);

.

                throw new System.ComponentModel.Win32Exception(ret);

.

namespace Win32

.

    public class NetApi32

.

            public UInt32 sv101_platform_id;

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.U4)] public UInt32 sv101_version_major;

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.U4)] public UInt32 sv101_version_minor;

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.U4)] public UInt32 sv101_type;

.

        [DllImport("netapi32.dll",EntryPoint="NetServerEnum")]

.

        [DllImport("netapi32.dll",EntryPoint="NetApiBufferFree")]

.

        [DllImport ("Netapi32", CharSet=CharSet.Unicode)]

.

        public static ArrayList GetServerList( NetApi32.SV_101_TYPES ServerType)

.

                        //Cast the pointer to a ulong so this addition will work on 32-bit or 64-bit systems.

.

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

.

Declare Function NetServerGetInfo Lib "netapi32.dll" (ByVal ServerName As String, _

.

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

.

      throw new System.ComponentModel.Win32Exception(ret);

.

    [DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]

.

    <DllImport("netapi32.dll", SetLastError:=True)> Private Shared Function NetSessionDel(<MarshalAs(UnmanagedType.LPWStr)> ByVal serverName As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal UncClientName As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal username As String) As Integer

.

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

.

            Int32 Level,

.

            ref Int32 entriesread,

.

            ref Int32 totalentries,

.

            ref Int32 resume_handle);

.

    <DllImport("netapi32.dll", SetLastError:=True)> _

.

    Public sesi502_num_opens As UInt32

.

    Public sesi502_time As UInt32

.

    Public sesi502_idle_time As UInt32

.

    Public sesi502_user_flags As UInt32

.

            Int32 er=0,tr=0,resume=0;

.

                    Int32 p = BufPtr.ToInt32();

.

                ptr = bufptr.ToInt32 + (Marshal.SizeOf(Result(i)) * i)

.

    [DllImport("Netapi32.dll")]

.

        Int32 dwLevel,

.

Declare Unicode Function NetShareAdd Lib "netapi32.dll" ( _

.

            public Int32 shi502_permissions;

.

            public Int32 shi502_max_uses;

.

            public Int32 shi502_current_uses;

.

            public Int32 shi502_reserved;

.

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

.

Declare Function NetShareCheck Lib "netapi32.dll" (TODO) As TODO

.

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

.

            Int32 reserved //must be 0

.

Declare Unicode Function NetShareDel Lib "netapi32.dll" _

.

    <DllImport("netapi32", CharSet:=CharSet.Unicode)> _

.

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

.

Declare Unicode Function NetShareEnum Lib "netapi32.dll" _

.

    <DllImport("Netapi32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _

.

            Dim i As Integer = 0, lpItem As Integer = pBuffer.ToInt32()

.

     currentPtr = New IntPtr(currentPtr.ToInt32 + Marshal.SizeOf(GetType(SHARE_INFO_2)))

.

         currentPtr = new IntPtr(currentPtr.ToInt32() + nStructSize);

.

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

.

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

.

            //Remember, 64-bit systems have 64-bit pointers. Using ToInt32 will cause an ArithmeticOverview exception.

.

            currentPtr = new IntPtr(currentPtr.ToInt32() + nStructSize);

.

    Declare Unicode Function NetShareEnum Lib "netapi32.dll" _

.

    Declare Unicode Function NetShareGetInfo Lib "netapi32.dll" _

.

    Declare Unicode Function NetApiBufferFree Lib "netapi32.dll" _

.

        Dim i As Integer = 0, lpItem As Integer = pBuffer.ToInt32()

.

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

.

    Int32 level,

.

Declare Unicode Function NetShareGetInfo Lib "netapi32.dll" _

.

  Declare Unicode Function NetShareGetInfo Lib "netapi32.dll" _

.

  Declare Unicode Function NetApiBufferFree Lib "netapi32.dll" _

.

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

.

            Int32 level,

.

            public Int32 shi502_permissions;

.

            public Int32 shi502_max_uses;

.

            public Int32 shi502_current_uses;

.

            public Int32 shi502_reserved;

.

        [DllImport("Netapi32", CharSet=CharSet.Auto)]

.

        [DllImport("Netapi32", CharSet=CharSet.Auto)]

.

        oManager = New ManagementClass("Win32_Share")

.

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

.

static extern UInt32 NetShareSetInfo(String servername, String netname, UInt32 level, ref object buf, out UInt32 parm_err);

.

Declare Function NetShareSetInfo Lib "netapi32.dll" (TODO) As TODO

.

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

.

Declare Function NetStatisticsGet Lib "Netapi32.dll" (TODO) As TODO

.

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

.

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

.

using DWORD = System.UInt32;

.

using NET_API_STATUS = System.UInt32;

.

[DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]

.

using DWORD = System.UInt32;

.

using NET_API_STATUS = System.UInt32;

.

      throw new Win32Exception((int)returnCode);

.

  const UInt32 USE_NOFORCE = 0;

.

  const UInt32 USE_FORCE = 1;

.

  const UInt32 USE_LOTS_OF_FORCE = 2;

.

  [DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]

.

  private static extern UInt32 NetUseDel(

.

      UInt32 ForceCond

.

Declare Function NetUseDel Lib "netapi32.dll" (TODO) As TODO

.

      throw new Win32Exception((int)returnCode);

.

[DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]

.

<DllImport("netapi32.dll", SetLastError:=True)> _

.

    ByVal Level As UInt32, _

.

    ByVal PreferedMaximumSize As UInt32, _

.

    Public ui2_status As UInt32

.

    Public ui2_asg_type As UInt32

.

    Public ui2_refcount As UInt32

.

    Public ui2_usecount As UInt32

.

                // lInfo=(USE_INFO_2)Marshal.PtrToStructure(new IntPtr(lBuffer.ToInt32()+(Marshal.SizeOf(typeof(USE_INFO_2))*li)),typeof(USE_INFO_2));

.

        NetUseEnum(Nothing, 2, lBuffer, UInt32.MaxValue, lRead, lTotal, lHandle)

.

        Dim RawPos As IntPtr = lBuffer.ToInt32() + (Marshal.SizeOf(GetType(USE_INFO_2)) * i)

.

[DllImport("netapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)]

.

     UInt32 level,

.

     out UInt32 parm_err);

.

Private Declare Function NetUserAdd Lib "Netapi32.dll" ( _

.

    Private Declare Function NetUserAdd Lib "Netapi32.dll" ( _

.

        Return New System.ComponentModel.Win32Exception(RetVal).Message

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


 
Access PInvoke.net directly from VS: