Page 1 of 1

Anyone ever used the SLIsGenuineLocal API before?

Posted: Sun Dec 09, 2012 7:46 pm
by SFSxOI
SLIsGenuineLocal > http://msdn.microsoft.com/en-us/library ... s.85).aspx

Anyone ever used this API in a purebasic implementation? If so, how did you handle the genuine validation windows GUID of 55c92734-d682-4d71-983e-d6ec3f16059f and get the function to work properly?
(defined in the sliddefs.h file as 'DEFINE_GUID(*WINDOWS_SLID, $55c92734, $d682, $4d71, $98, $3e, $d6, $ec, $3f, $16, $05, $9f)'

Re: Anyone ever used the SLIsGenuineLocal API before?

Posted: Sun Dec 09, 2012 8:44 pm
by luis
SFSxOI wrote:Anyone ever used this API in a purebasic implementation?
I didn't.

Something like this maybe ? It seems to work.

Code: Select all

Macro DEFINE_GUID (IID_NAME, l1, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
 DataSection 
  IID_NAME:
  Data.l l1
  Data.w w1, w2
  Data.b b1, b2, b3, b4, b5, b6, b7, b8
 EndDataSection
EndMacro

Enumeration 
 #SL_GEN_STATE_IS_GENUINE       
 #SL_GEN_STATE_INVALID_LICENSE   
 #SL_GEN_STATE_TAMPERED   
 #SL_GEN_STATE_LAST       
EndEnumeration

Define state

DEFINE_GUID (win_genuine, $55c92734, $d682, $4d71, $98, $3e, $d6, $ec, $3f, $16, $05, $9f)

hDll = OpenLibrary(#PB_Any, "Slwga.dll")    
 
If hDll 
    *SLIsGenuineLocal = GetFunction(hDll, "SLIsGenuineLocal")
    
    If *SLIsGenuineLocal
        If CallFunctionFast(*SLIsGenuineLocal, ?win_genuine, @state, 0) = #S_OK
            If state = #SL_GEN_STATE_IS_GENUINE
                Debug "Your Windows is genuine."
            Else
                Debug "Your Windows was cheaper."
            EndIf
        EndIf
    EndIf    
    CloseLibrary(hDll)
EndIf

Re: Anyone ever used the SLIsGenuineLocal API before?

Posted: Sun Dec 09, 2012 9:31 pm
by SFSxOI
Thanks luis, works perfectly.

Debug "Your Windows was cheaper."

LoL :)

Re: Anyone ever used the SLIsGenuineLocal API before?

Posted: Sun Dec 09, 2012 9:32 pm
by luis
:)

Good, thanks for letting me know.

Re: Anyone ever used the SLIsGenuineLocal API before?

Posted: Sun Dec 09, 2012 10:14 pm
by LuCiFeR[SD]
SFSxOI wrote:Thanks luis, works perfectly.

Debug "Your Windows was cheaper."

LoL :)
haha that made me laugh like a child too :)