Jump to content

Very Techie Windows Question


davidP

Recommended Posts

Long shot as this is a very techie question (well beyond me as a tester!)

 

I’m currently testing a system that when logging on uses the Windows function GetUserNameA to obtain the login ID of the current User. When we try the same thing under CITRIX however it doesn’t work. What I need to know therefore is where exactly does this function get the ID from? Is it in the registry somewhere, and if so where?

 

Thank you

DISCLAIMER: All opinions herein are fictitious. Any similarities to real

opinions, living or dead, are entirely coincidental.

Link to comment
Share on other sites

GetUserName() is the API you are looking for I think.

 

Citrex might just not like the GetUserNameA alias or not understand the call.

 

I'd expect some code in there somewhere similar to

 

Public Declare Function GetUserName Lib "advapi32.dll" _

Alias "GetUserNameA" ( _

ByVal lpBuffer As String, _

nSize As Long) As Long

 

Function GetLoginUserName() As String

Dim UserName As String

Dim NameLen As Long

 

NameLen = 2048

UserName = String(NameLen, 0)

GetUserName UserName, NameLen

GetLoginUserName = Left(UserName, NameLen)

End Function

 

[ 02. October 2003, 08:58 PM: Message edited by: Newt ]

" My choices in life were either to be a piano player in a whore house or a politician. And to tell the truth, there's hardly any difference!" - Harry Truman, 33rd US President

Link to comment
Share on other sites

Newt, it's definitely using that API. What I'm trying to find out is where does that API actually get the login ID from on the machine. We suspect the problem is that the Citrix session doesn't store the login ID in the same place as a normal login would, so we want to find out where it would normally be got from outside Citrix then have a look in the same place from within and see if it's there (did that make sense?).

I haven't even started on the fact that one uses NT and the other uses Win 2000 under Novell - that's too scary to contemplate!

DISCLAIMER: All opinions herein are fictitious. Any similarities to real

opinions, living or dead, are entirely coincidental.

Link to comment
Share on other sites

davidP - other than to say it's probably one of the severl places in HKCU that holds that info, can't help you.

 

Another thought occured though. If you are looking for a network logon name, you won't use the same call. WNetGetUser in that case and called from windows.pas.

 

I can imagine a system where all the users were network connected and no one console connected that would return names fine with WNetGetUser but bomb with GetUserName.

" My choices in life were either to be a piano player in a whore house or a politician. And to tell the truth, there's hardly any difference!" - Harry Truman, 33rd US President

Link to comment
Share on other sites

Thanks Newt, I've passed that on to the guy who's investigating the fault :)

DISCLAIMER: All opinions herein are fictitious. Any similarities to real

opinions, living or dead, are entirely coincidental.

Link to comment
Share on other sites

Let me know what he finally finds.

 

Strange there was no posting on this thread by anyone else though. :confused:

" My choices in life were either to be a piano player in a whore house or a politician. And to tell the truth, there's hardly any difference!" - Harry Truman, 33rd US President

Link to comment
Share on other sites

ajp - LOL :D:D

" My choices in life were either to be a piano player in a whore house or a politician. And to tell the truth, there's hardly any difference!" - Harry Truman, 33rd US President

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We and our partners use cookies on our website to give you the most relevant experience by remembering your preferences, repeat visits and to show you personalised advertisements. By clicking “I Agree”, you consent to the use of ALL the cookies. However, you may visit Cookie Settings to provide a controlled consent.