Proc code - Solutions - WINUSER
|
|
Windows NT/2000/XP USER/PASSWORD LAN-ID
Download It (include instructions) ! (5Kb)
To get the user id, you need to add the following line to your usys.ini (in [userdlls]):
path=c:\windows\system
;path=c:\winnt\system32 (if using NT)
demandload=advapi32.dll
Then create a new signature (e.g. API_GETUSERNAME),
Set the implementation to 'C'.
Create a new Operation called 'GETUSERNAME'.
In the details of the Operation, modify the Literal Name to
'GetUserNameA' and set the return value to 'in $status' and 'long'.
Create two parameters:
Name : Data Type, Basic 'String';
IN & OUT ;
Literal Name, 'name'
Interface, 'char * (length 2 * 10240)
SIZE : Data Type, 'Numeric';
IN & OUT;
Literal Name, 'size'
Interface, 'long'
In your code, you just need to call it, with a line such as:
activate "API_GETUSERNAME".getusername(O_USERNAME, IO_SIZE);
Where O_USERNAME will return the username.
Where you should set IO_SIZE to the maximum acceptable size for O_USERNAME (in bytes) (e.g. 32).
At the return from getusername, IO_SIZE will contains the real size of O_USERNAME (still in bytes).
You should set IO_SIZE to the maximum acceptable size for O_USERNAME (in
bytes) (e.g. 32), at the return from getusername, IO_SIZE will contains the
real size of O_USERNAME (still in bytes).
Information from David Jacquens DJacquens@uwic.ac.uk
Coded by Carles Zaragoza CarlesZ@yahoo.com
Download It (include instructions) ! (5Kb)
Copyright © 1999-2002 $UUU All rights reserved.
Disclaimer. |
Site Comments.