Anyone ever used the SLIsGenuineLocal API before?

Everything else that doesn't fall into one of the other PB categories.
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Anyone ever used the SLIsGenuineLocal API before?

Post 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
"Have you tried turning it off and on again ?"
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: Anyone ever used the SLIsGenuineLocal API before?

Post by SFSxOI »

Thanks luis, works perfectly.

Debug "Your Windows was cheaper."

LoL :)
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Anyone ever used the SLIsGenuineLocal API before?

Post by luis »

:)

Good, thanks for letting me know.
"Have you tried turning it off and on again ?"
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Re: Anyone ever used the SLIsGenuineLocal API before?

Post by LuCiFeR[SD] »

SFSxOI wrote:Thanks luis, works perfectly.

Debug "Your Windows was cheaper."

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