哪位大神能告诉小女子 Access Mask 如何用~
哪位大神能告诉小女子 Access Mask 怎么用~~~
如题,最近发现这个东西,但是网上资料太少,MSDN讲的又不全面,英文看得头都大了……目前就知道貌似分好几种,是一个设置权限的东西。但是不知道具体都用于哪些地方。。。
所以,还请有经验的大侠赐教!小女子感激不尽!
------解决方案--------------------
mk:@MSITStore:C:\MSDN98\98VS\2052\winbase.chm::/devdoc/live/pdwbase/accctrl_2hf0.htm
Access Control
The security provisions of Microsoft® Windows NT® are automatically available to Win32-based applications. Every application running on the system is subject to the security imposed by the particular configuration of the local Windows NT implementation. Windows NT is the only platform that supports Win32 security.
The impact of Windows NT security on most Win32 functions is minimal, and a Win32-based application not requiring security functionality usually does not need to incorporate any special code. However, you can use the security features of Windows NT to provide a number of services to a Win32-based application.
This overview describes the Windows NT security model for controlling access to Win32 objects such as files, and for controlling access to administrative functions such as setting the system time or auditing user actions. The Access-Control Model topic provides a high-level description of the access control components and how they interact with each other. Following this description are topics that discuss the access-control components:
Access Tokens
Security Descriptors
Access-Control Lists (ACLs)
Access-Control Entries (ACEs)
Access Rights and Access Masks
Security Identifiers (SIDs)
The following topics discuss common access-control tasks:
Modifying an Object's Security Descriptor
Checking a Thread's Access to an Object
Controlling Child Object Creation
Controlling Access to an Object's Properties
Requesting Access Rights to an Object
The following topics provide sample code for access-control tasks:
Modifying an Object's ACLs
Creating a Security Descriptor for a New Object
Enabling and Disabling Privileges
Searching for a SID in an Access Token
Taking Object Ownership
Converting a Binary SID to String Format
------解决方案--------------------
下例是查询注册表中某个键值时通过使用access mask请求KEY_QUERY_VALUE访问权限来打开某个键:
如题,最近发现这个东西,但是网上资料太少,MSDN讲的又不全面,英文看得头都大了……目前就知道貌似分好几种,是一个设置权限的东西。但是不知道具体都用于哪些地方。。。
所以,还请有经验的大侠赐教!小女子感激不尽!
windows c/c++
windows
c/c++
------解决方案--------------------
mk:@MSITStore:C:\MSDN98\98VS\2052\winbase.chm::/devdoc/live/pdwbase/accctrl_2hf0.htm
Access Control
The security provisions of Microsoft® Windows NT® are automatically available to Win32-based applications. Every application running on the system is subject to the security imposed by the particular configuration of the local Windows NT implementation. Windows NT is the only platform that supports Win32 security.
The impact of Windows NT security on most Win32 functions is minimal, and a Win32-based application not requiring security functionality usually does not need to incorporate any special code. However, you can use the security features of Windows NT to provide a number of services to a Win32-based application.
This overview describes the Windows NT security model for controlling access to Win32 objects such as files, and for controlling access to administrative functions such as setting the system time or auditing user actions. The Access-Control Model topic provides a high-level description of the access control components and how they interact with each other. Following this description are topics that discuss the access-control components:
Access Tokens
Security Descriptors
Access-Control Lists (ACLs)
Access-Control Entries (ACEs)
Access Rights and Access Masks
Security Identifiers (SIDs)
The following topics discuss common access-control tasks:
Modifying an Object's Security Descriptor
Checking a Thread's Access to an Object
Controlling Child Object Creation
Controlling Access to an Object's Properties
Requesting Access Rights to an Object
The following topics provide sample code for access-control tasks:
Modifying an Object's ACLs
Creating a Security Descriptor for a New Object
Enabling and Disabling Privileges
Searching for a SID in an Access Token
Taking Object Ownership
Converting a Binary SID to String Format
------解决方案--------------------
下例是查询注册表中某个键值时通过使用access mask请求KEY_QUERY_VALUE访问权限来打开某个键:
HKEY hKey;
char SubKeyName[] = "SOFTWARE\\Esterel Technologies\\Esterel SCADE";
char ValueName[] = "Esterel SCADE Path";
static BYTE scade_path[200];
DWORD Buffer;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, SubKeyName, 0, KEY_QUERY_VALUE , &hKey) == ERROR_SUCCESS)
{
Buffer = sizeof(scade_path);
if (RegQueryValueExA(hKey, ValueName, 0, NULL, scade_path, &Buffer) == ERROR_SUCCESS)
{
printf("SCADE Path: %s", scade_path);
}
}
RegCloseKey(hKey);