tags:

views:

46

answers:

2

I was trying to get a Uuid via NtAllocateUuids or simply calling UuidCreateSequential, but Windows wasn't able to get an Ethernet or token-ring hardware address for my laptop. And so, when the system is booting, windows sets the UuidSeed to a random number instead of a given MAC. --> uniqueness is guaranteed only until the system is next restarted.

I was trying to manual set the UuidSeed with NtSetUuidSeed but i was getting a STATUS_ACCESS_DENIED error. "Windows NT/2000 Native API Reference" has following remarks: --The token of the calling thread must have an AuthenticationId of SYSTEM_LUID

Is there any way to achieve this from a process, running as Administrator? Something like ImpersonateLoggedOnUser() could work but afaik this is also only accessible as LocalSystem :/

Thx ;)

A: 

You can create a program and schedule to run it using the AT command. The scheduling service run as the local system account. On Vista things are different and I'm not sure if that is possible any more. You could write your own service of course.

Martin Liversage
http://www.codeproject.com/KB/system/RunUser.aspxThis is also a way, starting a new process as LocalSystem.But i rather prefer using registry hardware ids to make my own uuid as using this workaround (starting a new process)So that's out of the question, but thanks so far.
5andr0
A: 

ImpersonateLoggedOnUser worked fine with a token handle returned from:

HANDLE GetLSAToken() //duplicate a system token from the "System" process

or

BOOL CreatePureSystemToken(HANDLE &hToken) //create a new system token

http://www.codeproject.com/KB/system/RunUser.aspx CoreCode.cpp

5andr0