Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Sep 16, 2019 11:39 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Get Computer SID and user SID for Windows XP and Windows 7.
PostPosted: Tue Aug 14, 2012 8:49 pm 
Offline

Joined: Thu May 13, 2010 7:27 pm
Posts: 341
Does anyone know of a method to get a Computer SID and a User SID for Windows XP and Windows 7?
I wrote an app that encrypts some data but I would like the encryption key to be generated from the computer SID,User SID and then I will also Salt it.
I tried to get the info from the Registry but those keys are blank on Windows 7.
psgetsid does what I want, but #1 it is someone elses software and #2 I rather not embed it into my application if I can avoid it.

Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: Get Computer SID and user SID for Windows XP and Windows
PostPosted: Wed Aug 15, 2012 12:20 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
You will need to use Declares to do it yourself. The first half of this answer describes how to get the user's SID in C++ using API calls (declares).

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Get Computer SID and user SID for Windows XP and Windows
PostPosted: Wed Aug 15, 2012 7:14 pm 
Offline

Joined: Thu May 13, 2010 7:27 pm
Posts: 341
Yea, I already saw those I have Google too. I was hoping someone already did it in RealBasic. I have a million ways to do it in .Net because that is what everyone is using.


Top
 Profile  
Reply with quote  
 Post subject: Re: Get Computer SID and user SID for Windows XP and Windows
PostPosted: Fri Aug 24, 2012 2:36 am 
Offline

Joined: Sun Nov 26, 2006 11:01 am
Posts: 58
Maybe this is an alternative for you, the Windows Functionality Suite has two functions to retrieve computername and username as string (but not the SID):

System Information.GetComputerName()
System Information.GetLoggedInUserName()


Top
 Profile  
Reply with quote  
 Post subject: Re: Get Computer SID and user SID for Windows XP and Windows
PostPosted: Fri Aug 24, 2012 12:05 pm 
Offline

Joined: Thu May 13, 2010 7:27 pm
Posts: 341
Oh I found some old code that I had from a project I did with VB6 to get the user SID. With the help with others it has been converted to RS.

Here it is:
viewtopic.php?f=6&t=45010&p=251407#p251407

IMO this is the best way to get a unique ID for a computer and an user.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group