GetNtmsObjectSecurity function

[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]

The GetNtmsObjectSecurity function reads the security descriptor for the specified RSM object.

Syntax

DWORD GetNtmsObjectSecurity(
  HANDLE               hSession,
  LPNTMS_GUID          lpObjectId,
  DWORD                dwType,
  SECURITY_INFORMATION RequestedInformation,
  PSECURITY_DESCRIPTOR lpSecurityDescriptor,
  DWORD                nLength,
  LPDWORD              lpnLengthNeeded
);

Parameters

hSession

Handle to the session returned by the OpenNtmsSession function.

lpObjectId

Unique identifier of the RSM object.

dwType

Object type. For a list of object types, see NtmsObjectsTypes.

RequestedInformation

A SECURITY_INFORMATION value that specifies the requested security data.

lpSecurityDescriptor

TBD

nLength

Length of the descriptor.

lpnLengthNeeded

Required length of the buffer if it is not large enough for the security descriptor, in bytes.

Return Value

This function returns one of the following values.

Value Meaning
ERROR_ACCESS_DENIED
READ_CONTROL access to the object is denied.

Windows XP:  No access rights are required.

ERROR_DATABASE_FAILURE
The database is inaccessible or damaged.
ERROR_INVALID_HANDLE
The session handle is missing or is not valid.
ERROR_INVALID_PARAMETER
The object ID is missing.
ERROR_NO_SECURITY_ON_OBJECT
There is no security information for this object.
ERROR_OBJECT_NOT_FOUND
The object ID is not valid.
ERROR_SUCCESS
The function was successful.

Remarks

RSM security uses the standard security descriptors and information members. This allows the standard security dialog boxes to be used to select RSM security. For more information, see the SetPrivateObjectSecurity function. For more information on RSM security, see RSM Security.

Requirements

   
Windows version Windows XP [desktop apps only] Windows Server 2003 [desktop apps only]
Target Platform Windows
Header ntmsapi.h
Library Ntmsapi.lib
DLL Ntmsapi.dll

See Also

EnumerateNtmsObject

Object Management Functions

SetNtmsObjectSecurity