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(
  __in   HANDLE hSession,
  __in   LPNTMS_GUID lpObjectId,
  __in   DWORD dwType,
  __in   SECURITY_INFORMATION RequestedInformation,
  __out  PSECURITY_DESCRIPTOR pSecurityDescriptor,
  __in   DWORD nLength,
  __out  LPDWORD lpnLengthNeeded
);

Parameters

  • hSession [in]
    Handle to the session returned by the OpenNtmsSession function.

  • lpObjectId [in]
    Unique identifier of the RSM object.

  • dwType [in]
    Object type. For a list of object types, see NtmsObjectsTypes.

  • RequestedInformation [in]
    A SECURITY_INFORMATION value that specifies the requested security data.

  • pSecurityDescriptor [out]
    Pointer to a SECURITY_DESCRIPTOR structure that receives the security descriptor.

  • nLength [in]
    Length of the descriptor.

  • lpnLengthNeeded [out]
    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/2000:  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

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

End of client support

Windows Vista

End of server support

Windows Server 2008

Header

Ntmsapi.h

Library

Ntmsapi.lib

DLL

Ntmsapi.dll

See Also

Object Management Functions

EnumerateNtmsObject

SetNtmsObjectSecurity

 

 

Send comments about this topic to Microsoft

Build date: 6/9/2011