未分类--Windows API--CreateProfile

来源:互联网 发布:北京电信网络 编辑:程序博客网 时间:2024/05/01 22:02

原文来自MSDN Library for Visual Studio 2008 SP1,翻译部分仅为个人观点,想要看更多信息请看MSDN,如有版权问题请联系QQ 643166601,邮件643166601@qq.com

 

CreateProfile Function

--------------------------------------------------------------------------------

Creates a new user profile.
创建一个新的用户配置文件。
Syntax

HRESULT WINAPI CreateProfile(         
LPCWSTR pszUserSid,
LPCWSTR pszUserName,
LPWSTR pszProfilePath,
DWORD cchProfilePath
);
Parameters

pszUserSid
[in] Pointer to the security identifier (SID) of the user as a string.
指针指向用户作为一个字符串的安全标识符(SID)。
pszUserName
[in] The user name of the new user.
这个新用户的用户名。
This name is used as the base name for the profile directory.
使用这个名称作为配置文件目录的基本名称。
pszProfilePath
[out] When this function returns, contains a pointer to the full path of the profile.
当这个函数返回时,包含一个指针指向配置文件的全路径。
cchProfilePath
[in] Size of the buffer pointed to by pszProfilePath, in characters.
由pszProfilePath指向的缓冲区的大小,以字符为单位。
Return Value

Returns S_OK if successful, or an error value otherwise, including the following:
如果成功返回S_OK,否则返是一个错误值,包含以下:
E_ACCESSDENIED
The caller does not have a sufficient permission level to create the profile.
这个调用者没有足够的权限级别去创建一个配置文件。
HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)
A profile already exists for the specified user.
指定的用户已经存在一个配置文件了。

Remarks

The caller must have administrator privileges to call this function.
这个调用者必须有管理员特权去调用这个函数。
Function Information

Minimum DLL Version Userenv.dll
Custom Implementation No
Header Userenv.h
Import library Userenv.lib
Minimum operating systems Windows Vista

 

 

0 0