|
Related Topics:
| Can't open udf on ie7 on vista Ultimate - Each time I try to open a pdf link on Vista Ultimate using IE or mozilla ,the pc stops and give err msg such as can't open file please update registry. pc is not working untill I kill the the only way for me to read those pdfs is to save..
Vista no enabled user in administrators group?? - I was trying to help someone resolve a problem on their newer Dell computer today with Vista Home Premium The user was having problems with Peachtree and up to a short time worked fine. The computer still works well as long as the..
Restarting a Windows Service with C# under Vista when User.. - Hello! I need to restart the Audio via C#. I'm using the Class to do this. It is no problem under XP and no problem under vista if UAC is disabled. But with enabled UAC i'm getting a
IE7 cannot open web site - Since a recent MS update download, IE7 has been unable to open one web site that I visit I have tried all the fixes by Windows help with no success. I removed each update one at a time, but that did not resolve the issue. I..
A thought on improving Vista security. - Hello everyone, I have an idea that I think would really help improve Vista security. At the same time, it would make Vista run faster and take up less space, and it would make things more difficult for malicious hackers. Could someone tell me the..
|
|
|
Next: Security: Can't open udf on ie7 on vista Ultimate
|
| Author |
Message |
External

Since: Apr 29, 2007 Posts: 2
|
(Msg. 1) Posted: Sun Apr 29, 2007 5:51 pm
Post subject: How to get the user name of a process when Vista UAC open? Archived from groups: microsoft>public>windows>vista>general, others (more info?)
|
|
|
|
| I can get the user name of a process in Windows XP by following code:
GetCurrentProcess();
GetSecurityInfo(handle,SE_KERNEL_OBJECT,OWNER_SECURITY_INFORMATION,&pSidOwner,NULL,NULL,NULL,&pSD);LookupAccountSid(NULL, pSidOwner, lpName,&cchName,lpReferencedDomainName,&cchReferencedDomainName, &peUse);But I failed in Vista when UAC opened:if the user of the process is in administrators group, and it is run asadministrator, the code above return the name (in lpName): "administrators"instead of the real user name.Who can help me?
|
|
|
| Back to top |
|
 |  |
External

Since: Sep 01, 2005 Posts: 29
|
(Msg. 2) Posted: Sun Apr 29, 2007 10:01 pm
Post subject: Re: How to get the user name of a process when Vista UAC open? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"Steff" <st_10 RemoveThis @hotmail.com> wrote in message
news:u5TIRPkiHHA.4772@TK2MSFTNGP04.phx.gbl...
>I can get the user name of a process in Windows XP by following code:
> GetCurrentProcess();
> GetSecurityInfo(handle,SE_KERNEL_OBJECT,OWNER_SECURITY_INFORMATION,&pSidOwner,NULL,NULL,NULL,&pSD);LookupAccountSid(NULL,
> pSidOwner,
> lpName,&cchName,lpReferencedDomainName,&cchReferencedDomainName,
> &peUse);But I failed in Vista when UAC opened:if the user of the process
> is in administrators group, and it is run asadministrator, the code above
> return the name (in lpName): "administrators"instead of the real user
> name.Who can help me?
>
Sounds like you need to use 'impersonation'
--
Jon |
|
| Back to top |
|
 |  |
External

Since: Apr 29, 2007 Posts: 2
|
(Msg. 3) Posted: Mon Apr 30, 2007 12:07 pm
Post subject: Re: How to get the user name of a process when Vista UAC open? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
I solved my question: should be use:
BOOL GetTokenInformation(
HANDLE TokenHandle,
TOKEN_INFORMATION_CLASS TokenInformationClass,
LPVOID TokenInformation,
DWORD TokenInformationLength,
PDWORD ReturnLength
);
in stead of GetSecurityInfo()."Jon" <Email_Address.DeleteThis@SomewhereOrOther.com>
??????:uOlsHGqiHHA.5044@TK2MSFTNGP05.phx.gbl...
> "Steff" <st_10.DeleteThis@hotmail.com> wrote in message
> news:u5TIRPkiHHA.4772@TK2MSFTNGP04.phx.gbl...
>>I can get the user name of a process in Windows XP by following code:
>> GetCurrentProcess();
>> GetSecurityInfo(handle,SE_KERNEL_OBJECT,OWNER_SECURITY_INFORMATION,&pSidOwner,NULL,NULL,NULL,&pSD);LookupAccountSid(NULL,
>> pSidOwner,
>> lpName,&cchName,lpReferencedDomainName,&cchReferencedDomainName,
>> &peUse);But I failed in Vista when UAC opened:if the user of the process
>> is in administrators group, and it is run asadministrator, the code above
>> return the name (in lpName): "administrators"instead of the real user
>> name.Who can help me?
>>
>
>
> Sounds like you need to use 'impersonation'
>
> --
> Jon |
|
| Back to top |
|
 |  |
|