SaferCreateLevel Function

The SaferCreateLevel function opens a SAFER_LEVEL_HANDLE.

Syntax

C++
BOOL WINAPI SaferCreateLevel(
  __in        DWORD dwScopeId,
  __in        DWORD dwLevelId,
  __in        DWORD OpenFlags,
  __out       SAFER_LEVEL_HANDLE *pLevelHandle,
  __reserved  LPVOID lpReserved
);

Parameters

dwScopeId [in]

The scope of the level to be created. The following table shows the possible values.

ValueMeaning
SAFER_SCOPEID_MACHINE
1

The created level is scoped by computer.

SAFER_SCOPEID_USER
2

The created level is scoped by user.

 

dwLevelId [in]

The level of the handle to be opened. The following table shows the possible values.

ValueMeaning
SAFER_LEVELID_CONSTRAINED
0x10000

Software cannot access certain resources, such as cryptographic keys and credentials, regardless of the user rights of the user.

SAFER_LEVELID_DISALLOWED
0x00000

Software will not run, regardless of the user rights of the user.

SAFER_LEVELID_FULLYTRUSTED
0x40000

Software user rights are determined by the user rights of the user.

SAFER_LEVELID_NORMALUSER
0x20000

Allows programs to execute as a user that does not have Administrator or Power User user rights. Software can access resources accessible by normal users.

SAFER_LEVELID_UNTRUSTED
0x01000

Allows programs to execute with access only to resources granted to open well-known groups, blocking access to Administrator and Power User privileges and personally granted rights.

 

OpenFlags [in]

This can be the following value.

ValueMeaning
SAFER_LEVEL_OPEN
1

 

pLevelHandle [out]

The returned SAFER_LEVEL_HANDLE. When you have finished using the handle, close it by calling the SaferCloseLevel function.

lpReserved

This parameter is reserved for future use. Set it to NULL.

Return Value

Returns nonzero if successful or zero otherwise.

For extended error information, call GetLastError.

Requirements

Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
HeaderWinSafer.h
LibraryAdvapi32.lib
DLLAdvapi32.dll

Send comments about this topic to Microsoft

Build date: 11/19/2009

Tags :


Page view tracker