The NetWkstaSetInfo function configures a workstation. This information remains in effect after the system has been reinitialized.
Only members of the Administrators local group can successfully execute NetWkstaSetInfo on a remote server.
NET_API_STATUS NetWkstaSetInfo(
LPWSTR servername,
DWORD level,
LPBYTE buffer,
LPDWORD parm_err
);
Value | Meaning |
---|---|
100 | The buffer parameter points to a WKSTA_INFO_100 structure. |
101 | The buffer parameter points to a WKSTA_INFO_101 structure. |
102 | The buffer parameter points to a WKSTA_INFO_102 structure. |
302 | The buffer parameter points to a WKSTA_INFO_302 structure. |
402 | The buffer parameter points to a WKSTA_INFO_402 structure. |
1101 | The buffer parameter points to a WKSTA_USER_INFO_1101 structure. |
In addition, the structures WKSTA_USER_INFO_502, WKSTA_USER_INFO_1010-1013, WKSTA_USER_INFO_1018, WKSTA_USER_INFO_1023, WKSTA_USER_INFO_1027, WKSTA_USER_INFO_1028, WKSTA_USER_INFO_1032, WKSTA_USER_INFO_1033, WKSTA_USER_INFO_1035, and WKSTA_USER_INFO_1041-1062 should not be set by the user.
Not all elements can be changed. Only those elements that have a specific PARMNUM constant value defined can be set. The following possible values are defined.
Value | Component to Set |
---|---|
PARMNUM_ALL | All elements |
WKSTA_CHARWAIT_PARMNUM | wki0_charwait |
WKSTA_CHARTIME_PARMNUM | wki0_chartime |
WKSTA_CHARCOUNT_PARMNUM | wki0_charcount |
WKSTA_ERRLOGSZ_PARMNUM | wki0_errlogsz |
WKSTA_PRINTBUFTIME_PARMNUM | wki0_printbuftime |
WKSTA_WRKHEURISTICS_PARMNUM | wki0_wrkheuristics |
WKSTA_OTHDOMAINS_PARMNUM | wki1_oth_domains |
If the function is successful, it returns NERR_SUCCESS.
If the function fails, the return value is one of the following error codes.
Value | Meaning |
---|---|
ERROR_ACCESS_DENIED | The user does not have access to the requested information. |
ERROR_INVALID_PARAMETER | One of the function parameters is invalid. |
You must be a member of the Administrators local group to successfully execute NetWkstaSetInfo on a remote server or on a computer that has local security enabled. NetWkstaSetInfo does not change values in the LANMAN.INI file. Values set by previous calls to NetWkstaSetInfo can be overwritten when workstation parameters are reset. When the Workstation service is stopped and restarted, parameters are reset to the default values specified in the LANMAN.INI file unless overwritten by command-line parameters.
Domain names in the wki1_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 wki1_oth_domains member cannot be set with MS-DOS. When setting this element, NetWkstaSetInfo 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 Net.
Windows NT: Requires version 3.1 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in lmwksta.h.
Import Library: Use netapi32.lib.
Networking (Net) Overview, Net Functions, NetWkstaGetInfo