Desktop Functions: Smart Device Functions:
|
Search Results for "POINT" in [All]netapi32
// we got back a valid pointer. Domains is an out parameter that receives a pointer to an array of DS_DOMAIN_TRUSTS structures. Each structure in this array contains trust data about a domain. The caller must free this memory when it is no longer required by calling NetApiBufferFree.
[DllImport("Netapi32.dll",EntryPoint="NetApiBufferFree")] 3: DsGetDcName Pointer to a PDOMAIN_CONTROLLER_INFO value that receives a pointer to a DOMAIN_CONTROLLER_INFO structure that contains data about the domain controller selected. This structure is allocated by DsGetDcName. The caller must free the structure using the NetApiBufferFree function when it is no longer required. 4: DsGetDcNext
[DllImport("Netapi32.dll", EntryPoint = "DsGetDcNextW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)] [out, optional] Pointer to a ULONG value that receives the number of elements in the SockAddresses array. If this parameter is NULL, socket addresses are not retrieved. [out, optional] Pointer to an array of SOCKET_ADDRESS structures that receives the socket address data for the domain controller. SockAddressCount receives the number of elements in this array. [out, optional] Pointer to a string pointer that receives the DNS name of the domain controller. This parameter receives NULL if no host name is known. The caller must free this memory when it is no longer required by calling NetApiBufferFree. 5: DsGetDcOpen
[DllImport("Netapi32.dll", EntryPoint = "DsGetDcOpenW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)] out Pointer to a HANDLE value that receives the domain controller enumeration context handle. This handle is used with the DsGetDcNext function to identify the domain controller enumeration operation. This handle is passed to DsGetDcClose to close the domain controller enumeration operation.
/// <param name="buffer">Pointer to a buffer.</param>
//Marshal the pointer to structure; pretty standard stuff 8: NetDfsEnum
/// <param name="DfsName">[in] Pointer to a string that specifies the name of the DFS root or a DFS link. </param>
/// <param name="Buffer">[out] Pointer to the address of a buffer that receives the requested information structures. The format of this data depends on the value of the Level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function. </param>
/// <param name="EntriesRead">[out] Pointer to a value that receives the actual enumerated DFS link count. </param>
/// <param name="ResumeHandle">[in, out] Pointer to a value that contains a handle which is used to continue the enumeration. The handle should be zero on the first call and left unchanged for subsequent calls. For more information, see the following Remarks section. Windows Server 2003: If ResumeHandle is NULL, then no resume handle is stored.</param> 9: NetDfsRemove
/// <param name="DfsEntryPath">[in] Pointer to a string that specifies the Universal Naming Convention path of a Dfs link in a named Dfs root. </param>
/// <param name="ServerName">[in] Pointer to a string that specifies the name of the host server that the Dfs link references.</param>
/// <param name="ShareName">[in] Pointer to a string that specifies the name of the shared folder or the path to a folder within a shared folder on the host server that the Dfs link references. </param>
''' <param name="DfsEntryPath">[in] Pointer to a string that specifies the Universal Naming Convention path of a Dfs link in a named Dfs root. </param>
''' <param name="ServerName">[in] Pointer to a string that specifies the name of the host server that the Dfs link references. Set this parameter to NULL if the link and all link targets are to be removed.</param>
''' <param name="ShareName">[in] Pointer to a string that specifies the name of the shared folder or the path to a folder within a shared folder on the host server that the Dfs link references. Set this parameter to NULL if the link and all link targets are to be removed.</param> 10: NetDfsSetInfo
/// <param name="DfsEntryPath">[in] Pointer to a string that specifies the Universal Naming Convention path of a Dfs link or a Dfs root. </param>
/// <param name="ServerName">[in, optional] Pointer to a string that specifies the name of the host server that the Dfs link references.</param>
/// <param name="ShareName">[in, optional] Pointer to a string that specifies the name of the shared folder or the path to a folder within a shared folder on the host server that the Dfs link references. </param>
/// <param name="Buffer">[in] Pointer to a buffer that specifies the data. The format of this data depends on the value of the Level parameter.</param> The buffer pointed to by lpNameBuffer (or domain in the C# signature) must be freed using the NetApiBufferFree function. 12: NetlGroupEnum The largest challenge is marshaling the pointer to the array of structures which the output is placed in. In this example, I use a do/while which doubles the size of the buffer until it is large enough to contain all of the groups that are on the server. The API call is designed so that you can read sequentially (ERROR_MORE_DATA), but I didn't want to deal with marshaling returned data stored in more than one of the pointers to the array of structures which the output is placed in! The largest challenge is marshaling the pointer to the array of structures which the output is placed in. In this example, I use a do/while which doubles the size of the buffer until it is large enough to contain all of the groups that are on the server. The API call is designed so that you can read sequentially (ERROR_MORE_DATA), but I didn't want to deal with marshaling returned data stored in more than one of the pointers to the array of structures which the output is placed in!
''' <param name="servername">Pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute.
''' <param name="msgname">Pointer to a constant string that specifies the message alias to which the message buffer should be sent.</param>
''' <param name="fromname">Pointer to a constant string specifying who the message is from.
''' <param name="buf">Pointer to a buffer that contains the message text.</param>
''' <param name="buflen">Specifies a value that contains the length, in bytes, of the message text pointed to by the buf parameter.</param>
// Increment UserInfo pointer
[DllImport("Netapi32.dll", EntryPoint = "NetRemoteComputerSupports", CharSet = CharSet.Unicode)]
[DllImport("Netapi32.dll", EntryPoint = "NetRemoteComputerSupports", CharSet = CharSet.Unicode)] 17: NetRemoteTOD
[DllImport( "netapi32.dll" , EntryPoint="NetRemoteTOD", SetLastError=true, lpServer - (in) Pointer to a constant string that specifies the DNS or NetBIOS name of the computer on which to call the function. If this parameter is NULL, the local computer is used. Windows NT: This string must begin with \\. lpNewMachineName - (in) Pointer to a constant string that specifies the new name of the computer. If specified, the local computer name is changed as well. If this parameter is NULL, the function assumes you have already called the SetComputerNameEx function. lpAccount - (in) Pointer to a constant string that specifies an account name to use when connecting to the domain controller. If this parameter is NULL, the caller's context is used. lpPassword - (in) If the lpAccount parameter specifies an account name, this parameter must point to the password to use when connecting to the domain controller. Otherwise, this parameter must be NULL.
/// <param name="Buffer">A pointer to a AT_JobInfo struct.</param>
''' <param name="Buffer">A pointer to a AT_JobInfo struct.</param> 20: netserverenum
[DllImport("netapi32.dll",EntryPoint="NetServerEnum")]
[DllImport("netapi32.dll",EntryPoint="NetApiBufferFree")]
/// Converts an <see cref="IntPtr"/> that points to a C-style array into a CLI array.
/// <param name="ptr">The <see cref="IntPtr"/> pointing to the native array.</param>
[DllImport("netapi32.dll",EntryPoint="NetServerEnum")]
[DllImport("netapi32.dll",EntryPoint="NetApiBufferFree")]
// cast pointer to a SERVER_INFO_101 structure
//Cast the pointer to a ulong so this addition will work on 32-bit or 64-bit systems. 21: NetServerGetInfo 1. ptrBuff is a pointer to a structure of type SERVER_INFO_100, SERVER_INFO_101 or SERVER_INFO_102. 22: NetSessionDel
''' <param name="serverName">[in] Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used. </param>
''' <param name="UncClientName">[in] Pointer to a string that specifies the computer name of the client to disconnect. If UncClientName is NULL, then all the sessions of the user identified by the username parameter will be deleted on the server specified by servername.</param>
''' <param name="username">[in] Pointer to a string that specifies the name of the user whose session is to be terminated. If this parameter is NULL, all users' sessions from the client specified by the UncClientName parameter are to be terminated.</param> 23: NetSessionEnum
''' <param name="serverName">[in] Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.</param>
''' <param name="UncClientName">[in] Pointer to a string that specifies the name of the computer session for which information is to be returned. If this parameter is NULL, NetSessionEnum returns information for all computer sessions on the server.</param>
''' <param name="userName">[in] Pointer to a string that specifies the name of the user for which information is to be returned. If this parameter is NULL, NetSessionEnum returns information for all users.</param>
''' <item>0 - Return the name of the computer that established the session. The bufptr parameter points to an array of SESSION_INFO_0 structures. </item>
''' <item>1 - Return the name of the computer, name of the user, and open files, pipes, and devices on the computer. The bufptr parameter points to an array of SESSION_INFO_1 structures. </item>
''' <item>2 - In addition to the information indicated for level 1, return the type of client and how the user established the session. The bufptr parameter points to an array of SESSION_INFO_2 structures. </item>
''' <item>10 - Return the name of the computer, name of the user, and active and idle times for the session. The bufptr parameter points to an array of SESSION_INFO_10 structures. </item>
''' <item>502 - Return the name of the computer; name of the user; open files, pipes, and devices on the computer; and the name of the transport the client is using. The bufptr parameter points to an array of SESSION_INFO_502 structures. </item>
''' [out] Pointer to the buffer that receives the data. The format of this data depends on the value of the level parameter.
''' <param name="entriesread">[out] Pointer to a value that receives the count of elements actually enumerated.</param>
''' <param name="totalentries">[out] Pointer to a value that receives the total number of entries that could have been enumerated from the current resume position. Note that applications should consider this value only as a hint.</param>
''' <param name="resume_handle">[in, out] Pointer to a value that contains a resume handle which is used to continue an existing session search. The handle should be zero on the first call and left unchanged for subsequent calls. If resume_handle is NULL, no resume handle is stored.</param>
/// Pointer is not valid. 24: NetShareEnum
' Enumerate over all shares on the server and find the any/all shares that point
//Remember, 64-bit systems have 64-bit pointers. Using ToInt32 will cause an ArithmeticOverview exception. 25: NetShareGetInfo
26: NetUnjoinDomain lpServer - (in) Pointer to a constant string that specifies the DNS or NetBIOS name of the computer on which the function is to execute. If this parameter is NULL, the local computer is used. lpAccount - (in) Pointer to a constant string that specifies the account name to use when connecting to the domain controller. The string must specify either a domain NetBIOS name and user account (for example, "REDMOND\user") or the user principal name (UPN) of the user in the form of an Internet-style login name (for example, "someone@example.com"). If this parameter is NULL, the caller's context is used. lpPassword - (in) If the lpAccount parameter specifies an account name, this parameter must point to the password to use when connecting to the domain controller. Otherwise, this parameter must be NULL. 27: USER_INFO_23
/// <summary>Pointer to a Unicode string that specifies the name of the user account</summary>
/// <summary>Pointer to a Unicode string that contains a comment associated with the user account.</summary>
/// <summary>Pointer to a Unicode string that contains a user comment.</summary>
/// <summary>Pointer to a SID structure that contains the security identifier (SID) that uniquely identifies the user.</summary> twain_3228: DSMparent [DllImport("twain_32.dll", EntryPoint="#1")] kernel3229: CloseHandle Unsafe Code refers to C# code with Pointers in it. "The use of pointers is rarely required in C#, but there are some situations that require them. Using an 'unsafe' context to allow pointers is warranted [... for use of] Advanced COM or Platform Invoke scenarios that involve structures with pointers in them" e.g. "You cannot return the same exact pointer from a native function that you took as a parameter. If a native function returns the pointer that has been marshaled to it by PInvoke[c or c++ or DllImport in c#], memory corruption and exceptions may ensue." http://msdn.microsoft.com/en-us/library/ms235282.aspx 30: ConsoleFunctions
// TODO: Test - what's an out uint[] during interop? This probably isn't quite right, but provides a starting point:
[DllImport("kernel32.dll", EntryPoint = "ReadConsoleInputW", CharSet = CharSet.Unicode)]
IntPtr.Zero - Since I did not need to pass it on to a child process, I decided to leave this pointer as null.
* 32: CreateEvent
EntryPoint:="CreateEventA")> _ 33: CreateFile
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta; 35: CreateMutex
/// Main entry point for the application. 36: CreateNamedPipe
[DllImport("kernel32.dll", EntryPoint = "CreateFile", SetLastError = true)]
[DllImport("kernel32.dll", EntryPoint = "PeekNamedPipe", SetLastError = true)] The key is to use Marshal.GetFunctionPointerForDelegate to get an IntPtr to the method that will serve as the thread proc. 38: DebugBreak
39: DefineDosDevice
DeleteVolumeMountPoint(@"Y:\");
static extern bool DeleteVolumeMountPoint(string lpszVolumeMountPoint); DeleteVolumeMountPoint(DriveLetter+":\\"); 41: DeviceIoControl
FsctlQueryRetrievalPointers = (EFileDevice.FileSystem << 16) | (14 << 2) | EMethod.Neither | (0 << 14),
FsctlGetRetrievalPointers = (EFileDevice.FileSystem << 16) | (28 << 2) | EMethod.Neither | (0 << 14),
FsctlSetReparsePoint = (EFileDevice.FileSystem << 16) | (41 << 2) | EMethod.Buffered | (0 << 14),
FsctlGetReparsePoint = (EFileDevice.FileSystem << 16) | (42 << 2) | EMethod.Buffered | (0 << 14),
FsctlDeleteReparsePoint = (EFileDevice.FileSystem << 16) | (43 << 2) | EMethod.Buffered | (0 << 14),
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _
[DllImport("kernel32.dll", EntryPoint = "EnumResourceNamesW", CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport("kernel32.dll", EntryPoint = "EnumResourceNamesW", CharSet = CharSet.Unicode, SetLastError = true)]
/// The main entry point for the application.
<DllImport("kernel32.dll", EntryPoint:="ExpandEnvironmentStringsW", SetLastError:=true, CharSet:=CharSet.Unicode)> _
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true, EntryPoint="CreateFileW")]
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _ 47: FormatMessage
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<System.Runtime.InteropServices.DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Unicode)> 48: FreeLibrary
<DllImport("kernel32.dll", SetLastError:=True, EntryPoint:="FreeLibrary")> _ 49: GetCommandLine 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.
[DllImport("kernel32.dll", SetLastError=true, EntryPoint="GetCompressedFileSize")]
//Need to use reflection to obtain pointer to the console output buffer
[DllImport("kernel32.dll", EntryPoint = "GetConsoleOriginalTitleW", CharSet = CharSet.Unicode, SetLastError = true)] 53: GetConsoleTitle
[DllImport("kernel32.dll", EntryPoint = "GetConsoleTitle", CharSet = CharSet.Unicode, SetLastError = true)] 54: GetCPInfo
/// <param name="codePage">The code page 'pointer' to look up.</param> 55: GetDriveType
/// <param name="lpRootPathName">A pointer to a null-terminated string that specifies the root directory and returns information about the disk.A trailing backslash is required. If this parameter is NULL, the function uses the root of the current directory.</param> 56: GetKeyboardTyре catch (EntryPointNotFoundException) Otherwise, an unhandled exception of type 'System.EntryPointNotFoundException' is thrown. 58: GetLogicalDrives bufferLength, The maximum size of the buffer pointed to by buffer, in TCHARs. This size does not include the terminating null character. If this parameter is zero, buffer is not used. buffer, A pointer to a buffer that receives a series of null-terminated strings, one for each valid drive in the system, plus with an additional null character. Each string is a device name.
[DllImport("KERNEL32.DLL", CharSet=CharSet::Auto, EntryPoint="GetPrivateProfileInt")]
<DllImport("kernel32.dll", SetLastError:=True, EntryPoint:="GetPrivateProfileIntA")> _
[DllImport("KERNEL32.DLL", CharSet=CharSet::Auto, EntryPoint="GetPrivateProfileString")] Cut off search results after 60. Please refine your search. |