RsopFileAccessCheck function (userenv.h)
The RSoPFileAccessCheck function determines whether a file's security descriptor grants a specified set of file access rights to the client identified by an RSOPTOKEN.
Syntax
USERENVAPI HRESULT RsopFileAccessCheck(
[in] LPWSTR pszFileName,
[in] PRSOPTOKEN pRsopToken,
[in] DWORD dwDesiredAccessMask,
[out] LPDWORD pdwGrantedAccessMask,
[out] LPBOOL pbAccessStatus
);
Parameters
[in] pszFileName
Pointer to the name of the relevant file. The file must already exist.
[in] pRsopToken
Pointer to a valid RSOPTOKEN representing the client attempting to gain access to the file.
[in] dwDesiredAccessMask
Specifies an access mask that indicates the access rights to check. This mask can contain a combination of generic, standard, and specific access rights. For more information, see Access Rights and Access Masks.
[out] pdwGrantedAccessMask
Pointer to an access mask that receives the granted access rights.
If the function succeeds, the pbAccessStatus parameter is set to TRUE, and the mask is updated to contain the standard and specific rights granted. If pbAccessStatus is set to FALSE, this parameter is set to zero. If the function fails, the mask is not modified.
[out] pbAccessStatus
Pointer to a variable that receives the results of the access check.
If the function succeeds, and the requested set of access rights are granted, this parameter is set to TRUE. Otherwise, this parameter is set to FALSE. If the function fails, the status is not modified.
Return value
If the function succeeds, the return value is S_OK. Otherwise, the function returns one of the COM error codes defined in the Platform SDK header file WinError.h.
Remarks
The RSoPFileAccessCheck function indicates, in the pbAccessStatus parameter, whether access is granted or denied to the client identified by the RSOPTOKEN. If access is granted, the requested access mask becomes the object's granted access mask.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | userenv.h |
Library | Userenv.lib |
DLL | Userenv.dll |