The information in this article applies to:
SUMMARYThe sample logoff program showing NetwkstaSetUid2 API call implementation in the LAN Manager "Programmers Reference Manual" can cause problems. The NetwkstaSetUid2 API call logs users on and off from the network and runs the logon script. Here is how the LAN Manager "Programmer's Reference Manual" explains implementation of the call on page 686: Text from the Programmer's Reference
ProblemsThe initial call made to find the number of bytes required to SafeMalloc for the pbBuffer is valid in most API calls and works fine, but when you use the NetWkstaSetUID2 API call to logoff a user, the above implementation returns error 2123 (buffer too small). This is valid, as the example gives a "NULL" for the username/password and data return fields.To work around this, set cbBuflen to a size that works in most cases. During the test on which this article is based, cbTotalAvail was normally about 8 bytes, so cbBuflen = 64 worked consistently. Fixing cbBuflen helps work around the problem because it uses the API call only once. Additional query words:
Keywords : |
Last Reviewed: November 5, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |