Not able to decode file permissions mask by using Win32API

Jean-Pierre Ribeauville 80 Reputation points
2024-07-23T12:15:53.3566667+00:00

Hello,

I'm trying , by using Win32 API on C langage , to retrieve owner and permissions of a file .Retrieving onwer is O.K.

Concerning retrieving file permissions , I'm able to list the 5 ACEs related to the security descriptor of the file.
The DACL has 5 ACEs with these values:

user james mask 0x1f01ff

user Utilisateurs authentifies mask 0x1301bf

user System mask 0x1f01ff

user Administrateurs mask 0x1f01ff

user Utilisateurs mask 0x1200a9

I'm not able to decode these mask values to retrieve permissions as cacls is able to do.
Answer of cacls for this file are correct :

cacls c:\tmp\myfile.txt

TITO\james:F

AUTORITE NT\Utilisateurs authentifiés:(ID)C

AUTORITE NT\Système:(ID)F

BUILTIN\Administrateurs:(ID)F

BUILTIN\Utilisateurs:(ID)R

Any help is welcome.
Thx.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,650 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 45,691 Reputation points
    2024-07-23T12:28:08.8066667+00:00

    You should be able to interpret the returned permissions contained in an ACE for a file by referring to

    File Access Rights Constants and Standard Access Rights. Also, you should be able to find these in the Windows header files (winnt.h).

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.