Desktop Functions: Smart Device Functions:
|
Search Results for "_stat" in [All]winscard
// SCARD_ATTR_ATR_STRING = SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0303) in WinSCard.h
private const int SCARD_STATE_UNAWARE = 0x00000000;
rs[0].dwCurrentState = SCARD_STATE_UNAWARE; Interfaces
,BINDSTATUS_COOKIE_STATE_UNKNOWN
,BINDSTATUS_COOKIE_STATE_ACCEPT
,BINDSTATUS_COOKIE_STATE_REJECT
,BINDSTATUS_COOKIE_STATE_PROMPT
,BINDSTATUS_COOKIE_STATE_LEASH
,BINDSTATUS_COOKIE_STATE_DOWNGRADE
int GetStatus( out uint hrStatus); //uses WORK_ITEM_STATUS
public enum WORK_ITEM_STATUS winfax
ref FAX_DEVICE_STATUS DeviceStatus); iphlpapi
public enum IF_OPER_STATUS : uint
public enum IP_DAD_STATE : uint
public IP_DAD_STATE DadState;
public IF_OPER_STATUS OperStatus;
public enum MIB_TCP_STATE {
MIB_TCP_STATE_CLOSED,
MIB_TCP_STATE_LISTEN,
MIB_TCP_STATE_SYN_SENT,
MIB_TCP_STATE_SYN_RCVD,
MIB_TCP_STATE_ESTAB,
MIB_TCP_STATE_FIN_WAIT1,
MIB_TCP_STATE_FIN_WAIT2,
MIB_TCP_STATE_CLOSE_WAIT,
MIB_TCP_STATE_CLOSING,
MIB_TCP_STATE_LAST_ACK,
MIB_TCP_STATE_TIME_WAIT,
MIB_TCP_STATE_DELETE_TCB kernel328: CreateMutex
EVENT_MODIFY_STATE = 0x00000002,
MUTEX_MODIFY_STATE = 0x00000001,
SEMAPHORE_MODIFY_STATE = 0x00000002,
TIMER_MODIFY_STATE = 0x00000002,
TIMER_QUERY_STATE = 0x00000001
IntPtr hMutex = Native.OpenMutex( ( uint ) ( Native.SyncObjectAccess.MUTEX_MODIFY_STATE ), false, name );
hMutex = Native.OpenMutex( ( uint ) ( Native.SyncObjectAccess.MUTEX_MODIFY_STATE ), false, name );
static extern bool GetSystemPowerStatus(out SYSTEM_POWER_STATUS 10: NetBIOS See Also: NCB, LANA_ENUM, ADAPTER_STATUS, NAME_BUFFER
Dim adapt As ADAPTER_STATUS
Dim myAdapt As New ADAPTER_STATUS 11: OpenEvent
const uint EVENT_MODIFY_STATE = 0x0002 ;
EVENT_MODIFY_STATE = 0x00000002,
MUTEX_MODIFY_STATE = 0x00000001,
SEMAPHORE_MODIFY_STATE = 0x00000002,
TIMER_MODIFY_STATE = 0x00000002,
TIMER_QUERY_STATE = 0x00000001
IntPtr handle= OpenEvent(EVENT_ALL_ACCESS | EVENT_MODIFY_STATE, false, name); 12: OpenMutex
const UInt32 MUTEX_MODIFY_STATE = 0x0001;
static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
public enum EXECUTION_STATE :uint
Note that the return value is the EXECUTION_STATE that ''was'' set. Description of what the different EXECUTION_STATE does
SetThreadExecutionState(EXECUTION_STATE.ES_DISPLAY_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS);
SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);
SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_AWAYMODE_REQUIRED);
SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED); msvcrt14: _stat
static extern int _stat(string file, ref STAT buf);
Declare Function _stat Lib "msvcrt.dll" (TODO) As TODO
int res = _stat(file, ref s); crypt32
[In, Out] ref CERT_REVOCATION_STATUS pRevStatus);
CERT_REVOCATION_STATUS revStatus = new CERT_REVOCATION_STATUS(); advapi3216: ControlService
public static extern bool ControlService(IntPtr hService, SERVICE_CONTROL dwControl, ref SERVICE_STATUS lpServiceStatus);
Public Function ControlService(ByVal hService As IntPtr, ByVal dwControl As SERVICE_CONTROL, ByRef lpServiceStatus As SERVICE_STATUS) As Boolean
Declare Function ControlService Lib "advapi32.dll" (ByVal hService As Long, ByVal lControlCode As Long, ByVal lpServiceStatus As SERVICE_STATUS) As Boolean See SERVICE_STATUS definition
public enum SERVICE_STATE : uint See SERVICE_STATUS definition Public Enum SERVICE_STATE As Integer
SERVICE_STATUS stat = new SERVICE_STATUS();
SERVICE_STATUS serviceStatus;
serviceStatus = new SERVICE_STATUS ();
private SERVICE_STATUS DoQueryServiceStatus ()
SERVICE_STATUS serviceStatus = new SERVICE_STATUS();
SERVICE_STATUS serviceStatus = new SERVICE_STATUS ();
SERVICE_STATUS serviceStatus = new SERVICE_STATUS();
ref SERVICE_STATUS lpServiceStatus);
internal static extern bool QueryServiceStatus (IntPtr hService, ref SERVICE_STATUS dwServiceStatus);
internal static extern bool SetServiceStatus (IntPtr hServiceStatus, ref SERVICE_STATUS lpServiceStatus); 17: CreateService
SERVICE_QUERY_STATUS = 0x00004,
SERVICE_QUERY_STATUS |
SERVICE_QUERY_STATUS |
SERVICE_QUERY_STATUS = &H4
SERVICE_QUERY_STATUS Or _
SERVICE_QUERY_STATUS Or _ 18: DeleteService
SERVICE_QUERY_STATUS = 0x00004,
SERVICE_QUERY_STATUS |
SC_MANAGER_QUERY_LOCK_STATUS = 0x00010,
SC_MANAGER_QUERY_LOCK_STATUS |
SERVICE_STATES dwServiceState,
ref ENUM_SERVICE_STATUS lpServices, SERVICE_STATES, SERVICE_TYPES, ENUM_SERVICE_STATUS, OpenSCManager, EnumServicesStatus, and OpenService
SERVICE_STATES.SERVICE_STATE_ALL,
SERVICE_STATES.SERVICE_STATE_ALL,
ENUM_SERVICE_STATUS serviceStatus;
serviceStatus = (ENUM_SERVICE_STATUS) Marshal.PtrToStructure( new IntPtr(iPtr), typeof(ENUM_SERVICE_STATUS) );
SERVICE_STATES.SERVICE_STATE_ALL,
SERVICE_STATES.SERVICE_STATE_ALL,
ENUM_SERVICE_STATUS depService;
depService = (ENUM_SERVICE_STATUS) Marshal.PtrToStructure( new IntPtr(iDepPtr), typeof(ENUM_SERVICE_STATUS) );
iDepPtr += ENUM_SERVICE_STATUS.SizeOf;
iPtr += ENUM_SERVICE_STATUS.SizeOf;
internal static ENUM_SERVICE_STATUS_PROCESS[] GetServices()
List<ENUM_SERVICE_STATUS_PROCESS> result = new List<ENUM_SERVICE_STATUS_PROCESS>();
ENUM_SERVICE_STATUS_PROCESS infoLevel = new ENUM_SERVICE_STATUS_PROCESS();
if (!EnumServicesStatusEx(handle, SC_ENUM_PROCESS_INFO, (int)ServiceType.SERVICE_WIN32, (int)ServiceStateRequest.SERVICE_STATE_ALL, IntPtr.Zero, 0, out iBytesNeeded, out iServicesReturned, ref iResumeHandle, null))
if (!EnumServicesStatusEx(handle, SC_ENUM_PROCESS_INFO, (int)ServiceType.SERVICE_WIN32, (int)ServiceStateRequest.SERVICE_STATE_ALL, buf, iBytesNeeded, out iBytesNeeded, out iServicesReturned, ref iResumeHandle, null))
ENUM_SERVICE_STATUS_PROCESS serviceStatus;
serviceStatus = (ENUM_SERVICE_STATUS_PROCESS)Marshal.PtrToStructure(new IntPtr(pointer),
typeof(ENUM_SERVICE_STATUS_PROCESS));
// incremement by sizeof(ENUM_SERVICE_STATUS_PROCESS) allow Packing of 8
pointer += ENUM_SERVICE_STATUS_PROCESS.SizePack8;
serviceStatus = (ENUM_SERVICE_STATUS_PROCESS)Marshal.PtrToStructure(new IntPtr(pointer),
typeof(ENUM_SERVICE_STATUS_PROCESS));
// incremement by sizeof(ENUM_SERVICE_STATUS_PROCESS) allow Packing of 4
pointer += ENUM_SERVICE_STATUS_PROCESS.SizePack4;
internal struct ENUM_SERVICE_STATUS_PROCESS
internal static readonly int SizePack4 = Marshal.SizeOf(typeof(ENUM_SERVICE_STATUS_PROCESS));
/// sizeof(ENUM_SERVICE_STATUS_PROCESS) allow Packing of 8 on 64 bit machines
internal static readonly int SizePack8 = Marshal.SizeOf(typeof(ENUM_SERVICE_STATUS_PROCESS)) + 4;
internal SERVICE_STATUS_PROCESS ServiceStatus;
internal struct SERVICE_STATUS_PROCESS
private enum ServiceStateRequest { SERVICE_ACTIVE = 0x1, SERVICE_INACTIVE = 0x2, SERVICE_STATE_ALL = (SERVICE_ACTIVE | SERVICE_INACTIVE) }
private enum ServiceControlManagerType { SC_MANAGER_CONNECT = 0x1, SC_MANAGER_CREATE_SERVICE = 0x2, SC_MANAGER_ENUMERATE_SERVICE = 0x4, SC_MANAGER_LOCK = 0x8, SC_MANAGER_QUERY_LOCK_STATUS = 0x10, SC_MANAGER_MODIFY_BOOT_CONFIG = 0x20, SC_MANAGER_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE | SC_MANAGER_ENUMERATE_SERVICE | SC_MANAGER_LOCK | SC_MANAGER_QUERY_LOCK_STATUS | SC_MANAGER_MODIFY_BOOT_CONFIG } 21: IsTextUnicode
IS_TEXT_UNICODE_STATISTICS = 0x0002,
IS_TEXT_UNICODE_REVERSE_STATISTICS = 0x0020,
Private NT_STATUS_OBJECT_NAME_NOT_FOUND As Integer = &HC0000034
Private NT_STATUS_OBJECT_NAME_NOT_FOUND As Integer = &HC0000034
Private NT_STATUS_OBJECT_NAME_NOT_FOUND As Integer = &HC0000034
If ret <> 0 And ret <> NT_STATUS_OBJECT_NAME_NOT_FOUND Then
internal static extern NET_API_STATUS NetValidatePasswordPolicy(
public NET_API_STATUS ValidationStatus;
internal enum NET_API_STATUS : uint
private static extern NET_API_STATUS NetValidatePasswordPolicyFree(ref IntPtr OutputArg);
NET_API_STATUS status = NetValidatePasswordPolicy(serverName, IntPtr.Zero, NET_VALIDATE_PASSWORD_TYPE.NetValidatePasswordChange, inputPointer, ref outputPointer);
if (status == NET_API_STATUS.NERR_Success)
if (outputArgs.ValidationStatus == NET_API_STATUS.NERR_Success) 26: OpenSCManager
SC_MANAGER_QUERY_LOCK_STATUS = 0x00010,
SC_MANAGER_QUERY_LOCK_STATUS |
SC_MANAGER_QUERY_LOCK_STATUS,
SC_MANAGER_QUERY_LOCK_STATUS = &H10
SC_MANAGER_QUERY_LOCK_STATUS Or _
SC_MANAGER_QUERY_LOCK_STATUS
Const SC_MANAGER_QUERY_LOCK_STATUS As Int32 = &H10
SC_MANAGER_QUERY_LOCK_STATUS Or _ For infoLevel only SC_STATUS_PROCESS_INFO (0x0) is allowed . See SERVICE_STATUS_PROCESS definition.
public static SERVICE_STATUS_PROCESS QueryServiceStatusEx(IntPtr serviceHandle)
return (SERVICE_STATUS_PROCESS)Marshal.PtrToStructure(buf, typeof(SERVICE_STATUS_PROCESS)); For infoLevel only SC_STATUS_PROCESS_INFO (0x0) is allowed . See SERVICE_STATUS_PROCESS definition. //NB for this code to work you will need to change the SERVICE_STATUS_PROCESS class to a struct
public static SERVICE_STATUS_PROCESS QueryServiceStatusEx(SafeHandle serviceHandle)
pData = Marshal.AllocHGlobal(sizeof(SERVICE_STATUS_PROCESS));
bool bOk = QueryServiceStatusEx(serviceHandle.DangerousGetHandle(), 0, pData, sizeof(SERVICE_STATUS_PROCESS), out
SERVICE_STATUS_PROCESS pStatus = (SERVICE_STATUS_PROCESS)Marshal.PtrToStructure(pData, typeof(SERVICE_STATUS_PROCESS)); ntdll30: NtCreateFile
public static extern int NtCreateFile(out SafeFileHandle handle, FileAccess access, OBJECT_ATTRIBUTES* objectAttributes, IO_STATUS_BLOCK* ioStatus, ref long allocSize, uint fileAttributes, FileShare share, uint createDisposition, uint createOptions, IntPtr eaBuffer, uint eaLength);
ref IO_STATUS_BLOCK ioStatus,
public struct IO_STATUS_BLOCK
IO_STATUS_BLOCK ioStatusBlock = new IO_STATUS_BLOCK();
[DllImport("ntdll.dll", SetLastError=true)] static extern IntPtr NtQueryInformationFile(IntPtr fileHandle, ref IO_STATUS_BLOCK IoStatusBlock, IntPtr pInfoBlock, uint length, FILE_INFORMATION_CLASS fileInformation);
Declare Function NtQueryInformationFile Lib "ntdll.dll" (ByVal fileHandle As IntPtr, ByRef IoStatusBlock As IO_STATUS_BLOCK, ByVal pInfoBlock As IntPtr, ByVal length As UInteger, ByVal fileInformation As FILE_INFORMATION_CLASS) As IntPtr
Structure IO_STATUS_BLOCK
struct IO_STATUS_BLOCK
struct IO_STATUS_BLOCK {
static extern IntPtr NtQueryInformationFile(SafeFileHandle fileHandle, ref IO_STATUS_BLOCK IoStatusBlock, IntPtr pInfoBlock, uint length, FILE_INFORMATION_CLASS fileInformation);
IO_STATUS_BLOCK iosb = new IO_STATUS_BLOCK(); coredllpublic static extern int DevicePowerNotify(string name, CEDEVICE_POWER_STATE state, int flags); public enum CEDEVICE_POWER_STATE : int DevicePowerNotify("WLP1:", CEDEVICE_POWER_STATE.D0, POWER_NAME); DevicePowerNotify("WLP1:", CEDEVICE_POWER_STATE.D4, POWER_NAME);
public static extern int GetSystemPowerStatusEx2(SYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2, [MarshalAs(UnmanagedType.U4), In] int dwLen, [MarshalAs(UnmanagedType.Bool), In] bool fUpdate);
SYSTEM_POWER_STATUS_EX2 SystemPowerStatusEx2 = new SYSTEM_POWER_STATUS_EX2();
public static extern int GetSystemPowerStatusEx2(ref SYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2, [MarshalAs(UnmanagedType.U4), In] int dwLen, [MarshalAs(UnmanagedType.Bool), In] bool fUpdate);
SYSTEM_POWER_STATUS_EX2 SystemPowerStatusEx2 = new SYSTEM_POWER_STATUS_EX2(); 35: SetSysColors
/// 25 COLOR_STATIC Background color for static controls and dialog boxes. Supported in Windows CE 2.0 and later.
/// 26 COLOR_STATICTEXT Color of the text for static controls. Supported in Windows CE 2.0 and later.
public const int COLOR_STATIC = (25 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_STATICTEXT = (26 | SYS_COLOR_INDEX_FLAG);
COLOR_STATIC,
COLOR_STATICTEXT,
Color.Green.ToArgb() & 0x00ffffff, //COLOR_STATIC
Color.Green.ToArgb() & 0x00ffffff, //COLOR_STATICTEXT
Const POWER_STATE_ON As Integer = &H10000
Const POWER_STATE_OFF As Integer = &H20000
Const POWER_STATE_SUSPEND As Integer = &H200000
Const POWER_STATE_RESET as Integer = &H800000 'this wil make the device soft reset! :)
SetSystemPowerState(Nothing, POWER_STATE_ON, POWER_FORCE)
SetSystemPowerState(Nothing, POWER_STATE_RESET, POWER_FORCE)
const int POWER_STATE_ON = 0x00010000;
const int POWER_STATE_OFF = 0x00020000;
const int POWER_STATE_SUSPEND = 0x00200000;
const int POWER_STATE_RESET = 0x00800000;
return SetSystemPowerState(null, POWER_STATE_ON, POWER_FORCE);
return SetSystemPowerState(null, POWER_STATE_RESET, POWER_FORCE); ws2_32
SO_BSP_STATE = 0x1009, netapi3239: NetDfsEnum
[DllImport("Netapi32.dll", CharSet = CharSet.Auto/*, SetLastError=true //Return value (NET_API_STATUS) contains error */)]
Dim state As DFS_STORAGE_STATES
DFS_STORAGE_STATES state; [2014-02-27] The function does not set the last error value, the error is returned directly and is in NET_API_STATUS format /Stoyan Sabev/
if (storage.State == (DFS_STORAGE_STATE_ACTIVE | DFS_STORAGE_STATE_ONLINE)) ActiveOnlineServer = storage.ServerName;
if (storage.State == (DFS_STORAGE_STATE_ACTIVE | DFS_STORAGE_STATE_ONLINE)) 41: NetDfsGetInfo
[DllImport("Netapi32.dll", CharSet=CharSet.Unicode/*, SetLastError=true //Return value (NET_API_STATUS) contains error */)] [Stoyan Sabev] The function does not set the last error value, the error is returned directly and is NET_API_STATUS form 42: NetFileClose
'NET_API_STATUS NetFileClose( 43: NetFileEnum
'NET_API_STATUS NetFileEnum(
ByRef bufferType As NETSETUP_JOIN_STATUS) _
As NET_API_STATUS
} // NETSETUP_JOIN_STATUS NET_API_STATUS - Possible return values are NERR_Success and ERROR_NOT_ENOUGH_MEMORY
Public Enum NETSETUP_JOIN_STATUS As UInteger
Public GroupType As NETSETUP_JOIN_STATUS
Public Enum NET_API_STATUS As UInteger
Public Enum NETSETUP_JOIN_STATUS As UInteger
ByRef bufferType As NETSETUP_JOIN_STATUS) _
As NET_API_STATUS
(ByVal lpBuffer As IntPtr) As NET_API_STATUS
Dim status As NET_API_STATUS
If status = NET_API_STATUS.NERR_Success Then
As NET_API_STATUS NET_API_STATUS - Possible value are NERR_Success, ERROR_NOT_ENOUGH_MEMORY and ERROR_INVALID_PARAMETER.
If NetRemoteComputerSupports(ComputerName, Wanted, supports) = NET_API_STATUS.NERR_Success Then 46: NetSessionDel NET_API_STATUS NetSessionDel( 47: NetSessionEnum
ERROR_INVALID_HANDLE_STATE = 1609, 48: NetUseAdd
using NET_API_STATUS = System.UInt32;
internal static extern NET_API_STATUS NetUseAdd(
internal DWORD ui2_status; using NET_API_STATUS = System.UInt32; 49: NetUseEnum
internal static extern NET_API_STATUS NetUseEnum(
ByRef resumeHandle As IntPtr) As NET_API_STATUS
internal DWORD ui2_status;
Public ui2_status As UInt32
Private Enum NET_USE_STATUS As UInteger shell3250: SHAppBarMessage
Public T_STATE As ABState
ABN_STATECHANGE = 0
retState.T_STATE = ABState.ABS_MANUAL
retState.T_STATE = ABState.ABS_ALWAYSONTOP
retState.T_STATE = ABState.ABS_AUTOHIDE
retState.T_STATE = ABState.ABS_AUTOHIDEANDONTOP
private uint BIF_STATUSTEXT = 0x0004; // Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if
out QUERY_USER_NOTIFICATION_STATE pquns);
enum QUERY_USER_NOTIFICATION_STATE Structures53: ADAPTER_STATUS
internal struct ADAPTER_STATUS
Private Structure ADAPTER_STATUS
typedef struct _ADAPTER_STATUS {
} ADAPTER_STATUS, *PADAPTER_STATUS; 55: DFS_INFO_2
public int State; // State of this volume, one of DFS_VOLUME_STATE_* 56: DFS_INFO_3
public int State; // State of this volume, one of DFS_VOLUME_STATE_* 57: DFS_INFO_4
public int State; // State of this volume, one of DFS_VOLUME_STATE_* 58: DFS_STORAGE_INFO
public int State; // State of this storage, one of DFS_STORAGE_STATE_*, possibly OR'd with DFS_STORAGE_STATE_ACTIVE
public struct ENUM_SERVICE_STATUS
public SERVICE_STATUS ServiceStatus;
Structure ENUM_SERVICE_STATUS
public SYSTEM_POWER_STATE LidOpenWakeAc;
public SYSTEM_POWER_STATE LidOpenWakeDc;
Public LidOpenWakeAc As SYSTEM_POWER_STATE
Public LidOpenWakeDc As SYSTEM_POWER_STATE Cut off search results after 60. Please refine your search. |