Access Check
This category covers access simulations in order to forecast behavior from the current user and provide a meaningful user interface (for example, there is no need to provide an encryption menu entry if the current user has no right to encrypt).
Enumerations
enum HSDCAccessCheckDepth : DWORD { HSDCAccessCheckDepthRights = 0, HSDCAccessCheckDepthRightsAndActions, HSDCAccessCheckDepthFull }
Functions
HSDCError HSDCAPI HSDCAccessCheckIsSystem (const wchar_t *path, BOOLEAN *pSystem)
Returns if the volume is controlled by Device Control. Volumes located on the physical hard drive containing the system volume are not controlled.
HSDCError HSDCAPI HSDCAccessCheckVolume (const wchar_t *path, const char *jstr, DWORD level, char **pJstr)
Computes effective accesses for a specific volume/drive letter. The full level of details requires Administrator privilege. Details can be controlled to provide different levels of access or also provide available actions that can be performed on the volume, such as encrypt/decrypt/recover access/and so on. Full level of details additionally provides information related to shadowing, file filtering, copy limit, and the device class/model/instance.
HSDCError HSDCAPI HSDCAccessCheck (const wchar_t *device, const char *jstr, char **pJstr)
Similar but more generic than the HSDCAccessCheckVolume call, this allows checks on devices without a drive letter (such as printers, portable devices, and so on), and it also allows simulation of hypothetical case (for example, would the user have write access after encrypting this USB stick). The output is a subset of the previous call since it contains only the rights part.
Enumeration Type Documentation
HSDCAccessCheckDepth
enum HSDCAccessCheckDepth : DWORD
Enumerators
Reports access rights. |
|
Reports access rights and actions. |
|
Reports access rights, actions, and all filtering, logging and device information. |
Function Documentation
HSDCAccessCheckIsSystem()
HSDCError HSDCAPI HSDCAccessCheckIsSystem ( const wchar_t * path, BOOLEAN * pSystem )
Returns if the volume is controlled by Device Control. Volumes located on the physical hard drive containing the system volume are not controlled.
Parameters
path |
Specifies the path/drive letter of the volume. |
pSystem |
[out] Returns TRUE (1) if the volume is on the system disk and not controlled, otherwise it returns FALSE (0) for controlled volumes. |
HSDCAccessCheckVolume()
HSDCError HSDCAPI HSDCAccessCheckVolume ( const wchar_t * path, const char * jstr, DWORD level, char ** pJstr )
Computes effective accesses for a specific volume/drive letter.
The full level of details requires Administrator privilege. Details can be controlled to provide different levels of access or also provide available actions that can be performed on the volume, such as encrypt/decrypt/recover access/and so on. Full level of details additionally provides information related to shadowing, file filtering, copy limit, and the device class/model/instance.
Parameters
path |
Non-null, non-empty path/drive letter of the volume to check. Must start with a letter. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jstr |
[Optional] Additional optional parameters enabling you to add or remove attributes to the device detected by path. Format is as follows: Copy
Valid list of attributes are:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
level |
Specifies the level of details that are needed. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pJstr |
[out] Returns a JSON string with all details, formatted as below: Copy
|
Returns
HSDCErrorSystemDrive |
Path references a volume on the system drive that is not monitored |
HSDCErrorSkCommFailure |
Unable to communicate with SK driver |
HSDCErrorInvalidIdentifier |
Encryption identifier is not valid/supported |
HSDCErrorInvalidVolume |
Unable to retrieve volume information |
HSDCAccessCheck()
HSDCError HSDCAPI HSDCAccessCheck ( const wchar_t * device, const char * jstr, char ** pJstr )
Similar but more generic than the HSDCAccessCheckVolume call, this allows checks on devices without a drive letter (such as printers, portable devices, and so on), and it also allows simulation of hypothetical case (for example, would the user have write access after encrypting this USB stick). The output is a subset of the previous call since it contains only the rights part.
Parameters
device |
Specifies the device name, volume with letter can be named as '\??\D:' |
jstr |
[optional] As in HSDCAccessCheckVolume() |
pJstr |
[out] Returns a JSON string with all details, formatted as below: Copy
|
Returns
HSDCErrorSystemDrive |
Path references a volume on the system drive that is not monitored |
HSDCErrorSkCommFailure |
Unable to communicated with SK driver |
HSDCErrorInvalidIdentifier |
Encryption identifier is not valid/supported |
HSDCErrorInvalidVolume |
Unable to retrieve volume information |