473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Need an alternative to GetUserName()

Hi,
I have a tool which is made in C and uses the API GetUserName(). But we have the problem as the user says it gives incorrect username "sometimes".
When the failure occurs, the username. that is retrieved is a valid but one not belonging to the logged on user. For example the staff number retrieved is 04982479, but when a failure occurs with the same user, instead of retrieving 04982479, another (valid) username is returned.

Is there anyt other API which I can use so as that logon name can be retrieved.?
Please help,

regards,
Venu
Jul 28 '08 #1
5 3157
gpraghuram
1,275 Expert 1GB
This API is specific to windows...
Dis u search in the MSDN to know the bugs in the API?

Raghu
Jul 28 '08 #2
This API is specific to windows...
Dis u search in the MSDN to know the bugs in the API?

Raghu
HI Raghu,
Yes I did, MSDN talks something like this, "If the current thread is impersonating another client, the GetUserName function returns the user name of the client that the thread is impersonating."

My tools runs only on windows. I need an alternative to this API for windows only. Could you please suggest me any ?
regards,
Venu
Jul 29 '08 #3
gpraghuram
1,275 Expert 1GB
Hi,
I am not very good in Windows programming and so i wont be in a position to answer this

raghu
Jul 29 '08 #4
For win32 api, just ask on Advanced Win32 api newsgroup :
news://194.177.96.26/comp.os.ms-windows.programmer.win32
Jul 29 '08 #5
For win32 api, just ask on Advanced Win32 api newsgroup :
news://194.177.96.26/comp.os.ms-windows.programmer.win32
Thanks for the feedback George.
Aug 5 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: smj92I | last post by:
Hello How to get the name of the user logged in the server side, is there something like GetUserName? Thanks
2
by: jack | last post by:
Hi everyone, In VB.NET, is getting the network username still the same as VB 6.0, i.e. using the the following API: Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"...
8
by: **Developer** | last post by:
I have a control called MyPanel that inherits from Panel. Also a control called MyRTB that inherits from RichTextBox. They are used on a form as follows: MyPanel in on the form and MyRTF is...
2
by: Diana | last post by:
I thought I had this process pretty well down pat, but I'm getting a syntax error on the following code: *****Code***** 'Check for users - can't get this to work... Dim strUser As String ...
18
by: bsruth | last post by:
I tried for an hour to find some reference to concrete information on why this particular inheritance implementation is a bad idea, but couldn't. So I'm sorry if this has been answered before....
7
by: lovecreatesbea... | last post by:
K&R 2, sec. 5.11 says that no need to precede function and array names with address-of operators &, why?
3
by: sunbeam | last post by:
Short Description of the Project: we developed a e-learning system for our students. each student has a unique username/password to view the modules he/she should view and nothing more. since we...
2
by: vijaykumardahiya | last post by:
Hello Sir, I have a simple Issue but It is not resolve by me i.e input parameter are not store in Ms-Access. I store the input parameter through Standard Action <jsp:useBean>. jsp:useBean call a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.