Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IMMDevice::GetState method

The GetState method retrieves the current device state.

Syntax


HRESULT GetState(
  [out] DWORD *pdwState
);

Parameters

pdwState [out]

Pointer to a DWORD variable into which the method writes the current state of the device. The device-state value is one of the following DEVICE_STATE_XXX constants:

DEVICE_STATE_ACTIVE

DEVICE_STATE_DISABLED

DEVICE_STATE_NOTPRESENT

DEVICE_STATE_UNPLUGGED

Return value

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return codeDescription
E_POINTER

Parameter pdwState is NULL.

 

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Mmdeviceapi.h

See also

IMMDevice Interface

 

 

Show:
© 2017 Microsoft