网站首页  词典首页

请输入您要查询的函数:

 

术语 netwkstausersetinfo
释义 NetWkstaUserSetInfo
语法:
C++
NET_API_STATUS NetWkstaUserSetInfo(
LPWSTR reserved,
__in DWORD level,
__in LPBYTE buf,
__out LPDWORD parm_err
);
NetWkstaUserSetInfo功能
该NetWkstaUserSetInfo函数设置的用户大约为工作站配置元素的具体资料。
参数
保留
此参数必须设置为0。
Level [in]
指定的数据信息的Level。此参数可以是下列值之一。
ValueMeaning
1Specifies信息工作站,包括当前用户名和工作站所访问的域名。在buf参数指向一个WKSTA_USER_INFO_1结构。
1101Specifies域浏览的工作站。在buf参数指向一个WKSTA_USER_INFO_1101结构。
缓冲带 [in]
缓冲区指针指定的数据。这一数据格式取决于Level的参数值。有关更多信息,请参阅网络管理功能的缓冲器。
parm_err [out]
指针的值,它接收的第一个参数是导致ERROR_INVALID_PARAMETER错误索引。如果该参数为NULL,则指数不返回的错误。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值可以是下面的错误代码之一。
返回codeDescription
ERROR_INVALID_LEVELTheLevel参数无效。
函数的参数ERROR_INVALID_PARAMETEROne是无效的。
备注
该NetWkstaUserSetInfo功能只能在本地。管理员组成员是必需的。
在WKSTA_USER_INFO_1101结构wkui1101_oth_domains成员域名是由空格分隔。一个空列表是有效的。阿空指针指离开成员不变。该wkui1101_oth_domains成员不能设置与MS - DOS。当设置这个元素,NetWkstaUserSetInfo拒绝该请求,如果名单是无效的,或者如果一个名字不能被添加到一个或由系统管理的多个网络适配器。
如果NetWkstaUserSetInfo函数返回ERROR_INVALID_PARAMETER,您可以使用parm_err参数表明该工作站用户信息结构的成员,是无效的。 (工作站用户信息结构开始WKSTA_USER_INFO_以及它的形式是指定的Level参数。)下表列出了可以返回的parm_err参数和相应的结构成员,在错误的价值。 (前缀wkui * _表明,成员国可以开始与多个前缀,例如,wkui0_或wkui1_。)
ValueMember
WKSTA_OTH_DOMAINS_PARMNUMwkui * _oth_domains
实例
下面的代码示例演示如何设置用户的使用调用NetWkstaUserSetInfo功能工作站的具体资料,说明信息化Level1101(WKSTA_USER_INFO_1101)。
#ifndef UNICODE
#define UNICODE
#endif
#pragma comment(lib, "netapi32.lib")
#include
#include
#include
int wmain(int argc, wchar_t *argv[])
{
DWORD dwLevel = 1101;
WKSTA_USER_INFO_1101 wui;
NET_API_STATUS nStatus;
if (argc != 2)
{
fwprintf(stderr, L"Usage: %s OtherDomains\\n", argv[0]);
exit(1);
}
//
// Fill in the WKSTA_USER_INFO_1101 structure member.
//
wui.wkui1101_oth_domains = argv[1];
//
// Call the NetWkstaUserSetInfo function
// to change the list of domains browsed by
// the workstation; specify level 1101.
//
nStatus = NetWkstaUserSetInfo(NULL,
dwLevel,
(LPBYTE)&wui,
NULL);
//
// Display the result of the call.
//
if (nStatus == NERR_Success)
fprintf(stderr, "Workstation user information has been changed\\n");
else
fprintf(stderr, "A system error has occurred: %d\\n", nStatus);
return 0;
}
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmwksta.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
工作站和工作站用户功能
NetWkstaUserGetInfo
WKSTA_USER_INFO_1
WKSTA_USER_INFO_1101
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetWkstaUserSetInfo Function
The NetWkstaUserSetInfo function sets the user-specific information about the configuration elements for a workstation.
Syntax
C++
NET_API_STATUS NetWkstaUserSetInfo(
LPWSTR reserved,
__in DWORD level,
__in LPBYTE buf,
__out LPDWORD parm_err
);
Parameters
reserved
This parameter must be set to zero.
level [in]
Specifies the information level of the data. This parameter can be one of the following values.
ValueMeaning
1Specifies information about the workstation, including the name of the current user and the domains accessed by the workstation. The buf parameter points to a WKSTA_USER_INFO_1 structure.
1101Specifies domains browsed by the workstation. The buf parameter points to a WKSTA_USER_INFO_1101 structure.

buf [in]
Pointer to the buffer that specifies the data. The format of this data depends on the value of the level parameter. For more information, see Network Management Function Buffers .
parm_err [out]
Pointer to a value that receives the index of the first parameter that causes the ERROR_INVALID_PARAMETER error. If this parameter is NULL, the index is not returned on error.
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value can be one of the following error codes.
Return codeDescription
ERROR_INVALID_LEVELThe level parameter is invalid.
ERROR_INVALID_PARAMETEROne of the function parameters is invalid.

Remarks
The NetWkstaUserSetInfo function only works locally. Administrator group membership is required.
Domain names in the wkui1101_oth_domains member of the WKSTA_USER_INFO_1101 structure are separated by spaces. An empty list is valid. A null pointer means to leave the member unmodified. The wkui1101_oth_domains member cannot be set with MS-DOS. When setting this element, NetWkstaUserSetInfo rejects the request if the name list was invalid or if a name could not be added to one or more of the network adapters managed by the system.
If the NetWkstaUserSetInfo function returns ERROR_INVALID_PARAMETER, you can use the parm_err parameter to indicate the member of the workstation user information structure that is invalid. (A workstation user information structure begins with WKSTA_USER_INFO_ and its format is specified by the level parameter.) The following table lists the value that can be returned in the parm_err parameter and the corresponding structure member that is in error. (The prefix wkui*_ indicates that the member can begin with multiple prefixes, for example, wkui0_ or wkui1_.)
ValueMember
WKSTA_OTH_DOMAINS_PARMNUMwkui*_oth_domains

Examples
The following code sample demonstrates how to set user-specific information for a workstation using a call to the NetWkstaUserSetInfo function, specifying information level 1101 ( WKSTA_USER_INFO_1101 ).
#ifndef UNICODE
#define UNICODE
#endif
#pragma comment(lib, "netapi32.lib")
#include
#include
#include
int wmain(int argc, wchar_t *argv[])
{
DWORD dwLevel = 1101;
WKSTA_USER_INFO_1101 wui;
NET_API_STATUS nStatus;
if (argc != 2)
{
fwprintf(stderr, L"Usage: %s OtherDomains\\n", argv[0]);
exit(1);
}
//
// Fill in the WKSTA_USER_INFO_1101 structure member.
//
wui.wkui1101_oth_domains = argv[1];
//
// Call the NetWkstaUserSetInfo function
// to change the list of domains browsed by
// the workstation; specify level 1101.
//
nStatus = NetWkstaUserSetInfo(NULL,
dwLevel,
(LPBYTE)&wui,
NULL);
//
// Display the result of the call.
//
if (nStatus == NERR_Success)
fprintf(stderr, "Workstation user information has been changed\\n");
else
fprintf(stderr, "A system error has occurred: %d\\n", nStatus);
return 0;
}
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmwksta.h (include Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
Network Management Overview
Network Management Functions
Workstation and Workstation User Functions
NetWkstaUserGetInfo
WKSTA_USER_INFO_1
WKSTA_USER_INFO_1101
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370671(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:23:26