Desktop Functions: Smart Device Functions:
|
Search Results for "system" in [All]netapi32
System.Net.Sockets.AddressFamily.InterNetwork, 2: DsGetDcName
System.Windows.Forms.MessageBox.Show ( msg); System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain() 3: DsGetDcNext
using HANDLE = System.IntPtr;
using DWORD = System.UInt32;
iReturn = DsGetDcOpen("domain1.mydomains.com", 1, "MYADSITE", (System.IntPtr)null, null, 0, out pDcContext); 4: DsGetDcOpen
using DWORD = System.UInt32;
using ULONG = System.UInt64;
iReturn = DsGetDcOpen("domain1.mydomains.com", 0, null, (System.IntPtr)null, null, 0, out pDcContext);
iReturn = DsGetDcOpen("domain1.mydomains.com", 1, "MYADSITE", (System.IntPtr)null, null, 0, out pDcContext);
internal static extern System.Int32 DsGetDcSiteCoverage(
out System.Int64 EntryCount,
Policies = new string[9, 2] { { "System", "" }, { "Logon", "" }, { "Object Access", "" }, { "Privilige Use", "" }, { "Detailed Tracking", "" }, { "Policy Change", "" }, { "Account Management", "" }, { "Directory Service Access", "" }, { "Account Logon", "" } };
LSA_UNICODE_STRING aSystemName = new LSA_UNICODE_STRING();
aSystemName.SetTo(this.ResourceName);
uint aOpenPolicyResult = LsaOpenPolicy(ref aSystemName, ref aObjectAttributes, aAccess, out aPolicyHandle); 7: NetDfsAdd 8: NetDfsEnum
/// The NetDfsEnum function enumerates all the Distributed File System (Dfs) links in the named Dfs root. The function returns information about the Dfs links based on information specified by the Level parameter.
/// <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>
/// <returns>If the function succeeds, the return value is NERR_Success. If no more entries are available to be enumerated, the return value is ERROR_NO_MORE_ITEMS. If the function fails, the return value is a system error code</returns> 10: NetDfsRemove
/// The NetDfsRemove function removes a target from a Distributed File System (Dfs) link. If the specified target is the last associated with the Dfs link, then the NetDfsRemove function also removes the link.
/// <returns>If the function succeeds, the return value is NERR_Success. If the function fails, the return value is a system error code</returns>
''' The NetDfsRemove function removes a target from a Distributed File System (Dfs) link. If the specified target is the last associated with the Dfs link, then the NetDfsRemove function also removes the link.
''' <returns>If the function succeeds, the return value is NERR_Success. If the function fails, the return value is a system error code</returns> 11: NetDfsSetInfo
/// The NetDfsSetInfo function sets or modifies the information associated with a Distributed File System (Dfs) link in the named Dfs root, or with the Dfs root itself. The function can set information relevant to a specific root, root target, link, or link target.
System.DirectoryServices.ActiveDirectory.Domain.GetComputerDomain();
Imports System.Runtime.InteropServices 13: NetJoinDomain If the function fails, the return value can be one of the following error codes or one of the system error codes. Here's some sample code that can do this using System.DirectoryServices
string computerName = SystemInformation.ComputerName;
using System;
using System.Text;
using System.Runtime.InteropServices;
string SystemName, 15: NetLocalGroupDel
string SystemName,
string SystemName,
''' Windows NT: No special group membership is required to execute the NetMessageBufferSend function on a LAN Manager or a Windows NT system.
using System;
using System.Runtime.InteropServices;
System.IntPtr UsrBuf = System.IntPtr.Zero;
System.IntPtr item = System.IntPtr.Zero;
if (item != System.IntPtr.Zero)
// Free buffer (allocated by system)
if (UsrBuf != System.IntPtr.Zero)
public System.IntPtr usri1_name;
public System.IntPtr usri1_comment;
public System.IntPtr usri1_full_name;
public System.IntPtr grp_name;
public System.IntPtr grp_comment;
public System.IntPtr usri2_name;
public System.IntPtr usri2_comment;
int Level, int ResumeHandle, int EntriesRequested, int prefMaxLength, out int entriesRead, out System.IntPtr Buffer);
[DllImport("netapi32.dll", CharSet=CharSet.Auto, SetLastError=true)] private static extern int NetApiBufferFree (System.IntPtr pBuffer);
System.IntPtr x = System.IntPtr.Zero;
if (x != System.IntPtr.Zero)
if (x != System.IntPtr.Zero)
if (x != System.IntPtr.Zero)
if (x != System.IntPtr.Zero)
if (x != System.IntPtr.Zero)
if (x != System.IntPtr.Zero) 20: NetRemoteTOD using System; using System.IO; using System.Windows.Forms; using System.Runtime.InteropServices;
if ( pintError > 0 ) { throw new System.ComponentModel.Win32Exception ( pintError ); } using System; using System.Runtime.InteropServices;
using System.DirectoryServices.ActiveDirectory; 22: netserverenum
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
throw new System.ComponentModel.Win32Exception(ret);
throw new System.ComponentModel.Win32Exception(ret);
namespace System.Runtime.InteropServices
using System;
using System.Runtime.InteropServices;
using System.Collections ;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.U4)]
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
[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;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] public string sv101_comment;
//Cast the pointer to a ulong so this addition will work on 32-bit or 64-bit systems. The System.Data.Sql.SqlDataSourceEnumerator class is an alternative to this API, for enumerating SQL Servers on a network. 23: NetServerGetInfo
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
level = int.Parse(System.Text.RegularExpressions.Regex.Replace(typeof(T).Name, @"[^\d]", ""));
throw new System.ComponentModel.Win32Exception(ret); 24: NetSessionEnum
''' This buffer is allocated by the system and must be freed using the NetApiBufferFree function. Note that you must free the buffer even if the function fails with ERROR_MORE_DATA. 25: NetShareEnum
' Clean up buffer allocated by system
If System.String.Compare(shi2.shi2_path, "c:\deletemeplease" True) = 0 Then
private void button1_Click(object sender, System.EventArgs e)
//Remember, 64-bit systems have 64-bit pointers. Using ToInt32 will cause an ArithmeticOverview exception.
Imports System
Imports System.Runtime.InteropServices
Imports System.text
' Clean up buffer allocated by system 26: NetShareGetInfo
Imports System
Imports System.Runtime.InteropServices
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
Imports System.Management 27: NetStatisticsGet
System.Console.WriteLine(aRebootTime); 28: NetUseAdd
using BOOL = System.Boolean;
using DWORD = System.UInt32;
using LPWSTR = System.String;
using NET_API_STATUS = System.UInt32; using System.Runtime.InteropServices; using BOOL = System.Boolean; using DWORD = System.UInt32; using LPWSTR = System.String; using NET_API_STATUS = System.UInt32; 29: NetUseEnum
// previous line has been causing "arithmetic operation resulted in an overflow" exception on x86 systems for me. Fixed with the .Add method. 30: NetUserAdd
Return New System.ComponentModel.Win32Exception(RetVal).Message 31: NetUserEnum
// Passing -1 as prefmaxlen makes the system allocate the buffer. using System.DirectoryServices; //System.DirectoryServices 32: NetUserGetInfo
//throw new System.ApplicationException("Could not get user's Full Name."); Imports System.Runtime.InteropServices Imports System.Runtime.InteropServices.UnmanagedType Imports System.Runtime.InteropServices.Marshal Imports System.Runtime.InteropServices.StructLayoutAttribute I added the Sample code for x64 systems because when I ran it, I kept getting an arithmetic overflow error. I tried forcing PowerShell to compile it for x86, but then I would get an invalid image error. Converting all the "int" to "Int64" seems to do the trick.
using System;
using System.Runtime.InteropServices;
using System.Collections;
using System.Net.Sockets; Sample PowerShell Code for x64 systems
using System;
using System.Runtime.InteropServices;
using System.Collections; 34: NetValidateName
using System;
using System.Runtime.InteropServices;
using System;
using System.Runtime.InteropServices;
using System;
using System.Runtime.InteropServices; 35: NetWkstaUserEnum Shared Function NetWkstaUserEnum(ByVal servername As String, ByVal level As Integer, <System.Runtime.InteropServices.Out()> ByRef bufptr As IntPtr, ByVal prefmaxlen As Integer, <System.Runtime.InteropServices.Out()> ByRef entriesread As Integer, <System.Runtime.InteropServices.Out()> ByRef totalentries As Integer, ByRef resume_handle As Integer) As Integer WMI can do this sort of thing (the System.Management namespace in .Net 2.0) If you want to find the user logged in to the workstation, consider instead a WMI query ("select UserName from Win32_ComputerSystem"), which has certain advantages (runs faster, less ambigious results, doesn't require Interop if using .Net 2.0 System.Management namespace, etc.)
Console.WriteLine("A system error has occurred : " + nStatus);
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
System.Windows.Forms.MessageBox.Show(domain); glossaryDistributed computing is a programming model in which processing occurs in many different places (or nodes) around a network. Processing can occur wherever it makes the most sense, whether that is on a server, personal computer, handheld device, or other smart device. In contrast to the two-node system prevalent today (the client and the centralized server), Microsoft .NET uses distributed computing. 38: LibHolocaust
Namespaces: System.AIPCC.Pinvoke.Functions (seperated further by libname, wont list it here though)
System.AIPCC.Pinvoke.Structures
System.AIPCC.Pinvoke.Enums
System.AIPCC.Pinvoke.Constants
System.AIPCC.Pinvoke.Callbacks (delegates)
Namespaces: System.AIPCC.Pinvoke.COM.UUID
System.AIPCC.Pinvoke.COM.Interfaces
System.AIPCC.Pinvoke.COM.Classes
System.AIPCC.Pinvoke.COM <- contains base functions such as CoInitialize() gsapi
private static extern void gsapi_delete_instance(System.IntPtr pinstance);
Private Shared Sub gsapi_delete_instance(ByVal pinstance As System.IntPtr)
System.IntPtr pinstance; /* Class instance variable */
if (pinstance != System.IntPtr.Zero)
pinstance = System.IntPtr.Zero; 40: gsapi_exit
System.IntPtr pinstance; /* Class instance variable */
if (pinstance != System.IntPtr.Zero)
pinstance = System.IntPtr.Zero;
private static extern int gsapi_new_instance(ref System.IntPtr pinstance, System.IntPtr handle);
Private Shared Function gsapi_new_instance(ByRef pinstance As System.IntPtr, ByVal handle As System.IntPtr) As Integer
System.IntPtr pinstance= IntPtr.Zero; using System; using System.Runtime.InteropServices;
private static extern int gsapi_new_instance(ref System.IntPtr pinstance, System.IntPtr handle);
private static extern void gsapi_delete_instance(System.IntPtr pinstance); kernel3242: ActivateActCtx
rgchFullModulePath = System.Reflection.Assembly.GetExecutingAssembly().Location; 43: AddAtom [System.String.Intern] is the closest thing, although an atom is different from a string. 44: AllocConsole
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 45: APIGetVersionEx
Dim si As New SYSTEM_INFO
GetSystemInfo(si) System.Environment.OSVersion is provided in all .Net versions and has the same information. OperatingSystem Class from System namespace has similar properties and methods
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 47: ConnectNamedPipe
[In] ref System.Threading.NativeOverlapped lpOverlapped); 48: ConsoleFunctions
using System;
using System.Text;
using System.Runtime.InteropServices;
public COLORREF(System.Drawing.Color color)
public System.Drawing.Color GetColor()
return System.Drawing.Color.FromArgb((int)(0x000000FFU & ColorDWORD),
public void SetColor(System.Drawing.Color color)
using System.Runtime.InteropServices; // Needed for the DllImport Attribute
throw new System.ComponentModel.Win32Exception(err); 50: CreateEvent
using System;
using System.Runtime.InteropServices; I think that in .NET 2.0 the System.Threading.EventWaitHandle class does the same that the example. 51: CreateFile
Win32API.SYSTEM_INFO sysinfo = new Win32API.SYSTEM_INFO();
Win32API.GetSystemInfo(ref sysinfo);
internal static IntPtr CreateFileMapping(System.IO.FileStream File, FileMapProtection flProtect, Int64 ddMaxSize, string lpName)
internal static extern void GetSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);
internal struct SYSTEM_INFO
Win32API.SYSTEM_INFO sysinfo = new Win32API.SYSTEM_INFO();
Win32API.GetSystemInfo(ref sysinfo);
internal static IntPtr CreateFileMapping(System.IO.FileStream File, FileMapProtection flProtect, Int64 ddMaxSize, string lpName)
internal static extern void GetSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);
internal struct SYSTEM_INFO 53: CreateHardLink
using System.Runtime.InteropServices;
using System; 54: CreateMutex 55: CreateNamedPipe
ACCESS_SYSTEM_SECURITY = 0x01000000L
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Text;
/// and a System.IO.Stream subclass. Basically, it simplifies the unnecessarily horrific process
System.Threading.Thread.Sleep(dataRead ? 50 : 1000);
System.Threading.Thread.Sleep(1000); 56: CreateProcess [System.Diagnostics.Process.Start] 58: CreateThread
SecurityAttributes, uint StackSize, System.Threading.ThreadStart StartFunction, Try System.Threading.Thread.Start. It doesn't give you all the control of directly calling CreateThread, (such as specifing the flags), but it will get you a vanilla thread to spin up. 59: CreateTimerQueue
/// The callback function can perform a long wait. This flag helps the system to decide if it should create a new thread.
/// The callback function can perform a long wait. This flag helps the system to decide if it should create a new thread. Cut off search results after 60. Please refine your search. |