Re: Anyone ever used the SLIsGenuineLocal API before?
Posted: Sun Dec 09, 2012 8:44 pm
I didn't.SFSxOI wrote:Anyone ever used this API in a purebasic implementation?
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