Article ID: 100389
Article Last Modified on 9/30/2003
/********************************************************************/
// Make an initial call to determine the required return buffer size.
uRetCode = NetWkstaSetUID2(NULL, // Reserved; must be NULL
NULL, // Domain to log on to
NULL, // User to logon or null=logoff
NULL, // User password if logon
"", // Reserved; must be null string
0, // Logoff force
1, // Level; must be 1
NULL, // Logon data returned
0, // Size of data area, in bytes
&cbTotalAvail); // Count of total bytes available
cbBuflen = cbTotalAvail;
pbBuffer = SafeMalloc(cbBuflen);
uRetCode = NetWkstaSetUID2(NULL, // Reserved; must be NULL
pszDomainName, // Domain to log on to
pszUserName, // User to logon or null=logoff
pszPassword, // User password if logon
"", // Reserved; must be null string
usLogoffForce, // Logoff force
1, // Level; must be 1
pbBuffer, // Logon data returned
cbBuflen, // Size of buffer, in bytes
&cbTotalAvail); // Count of total bytes available
printf("NetWkstaSetUID2 returned %u\n", uRetCode);
/********************************************************************/
Keywords: KB100389