Platform SDK: Removable Storage Manager

SetNtmsObjectSecurity

The SetNtmsObjectSecurity function writes the security descriptor for the specified RSM object.

DWORD WINAPI SetNtmsObjectSecurity(
  HANDLE hSession,
  LPNTMS_GUID lpObjectId,
  DWORD dwType,
  SECURITY_INFORMATION lpSecurityInformation,
  PSECURITY_DESCRIPTOR lpSecurityDescriptor
);

Parameters

hSession
Handle to the session returned by the OpenNtmsSession function.
lpObjectId
Specifies the unique identifier of the RSM object.
dwType
Specifies the RSM object type. See the EnumerateNtmsObject function for object types.
lpSecurityInformation
Specifies the security information to write to the RSM object.
lpSecurityDescriptor
Specifies the security descriptor to write to the RSM object: NTMS_USE_ACCESS, NTMS_CONTROL_ACCESS, or NTMS_MODIFY_ACCESS.

Return Values

Value Meaning
ERROR_ACCESS_DENIED The privileges required to modify the security descriptor are denied.
ERROR_DATABASE_FAILURE The database is inaccessible or damaged.
ERROR_DATABASE_FULL The database is full.
ERROR_INVALID_HANDLE The session handle is invalid or missing.
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 invalid.
ERROR_SUCCESS The function was successful.

Remarks

If an application uses the SetNtmsObjectSecurity function to set the owner of an object, the application must have WRITE_OWNER permission or be the owner of the object.

If an application uses SetNtmsObjectSecurity to set the discretionary access-control list (ACL) of an object, the application must have WRITE_DAC permission or be the owner of the object.

If an application uses SetNtmsObjectSecurity to set the system ACL of an object, the SE_SECURITY_NAME privilege must be enabled for the application.

For more information on Windows 2000 security, see the SetPrivateObjectSecurity function and the security section in the Platform SDK. For more information on RSM security, see RSM Security.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntmsapi.h.
  Library: Use Ntmsapi.lib.

See Also

Object Management Functions, EnumerateNtmsObject, GetNtmsObjectSecurity