Hello Chaps,
I've been beating my head against a wall with this for a while, and now I think I can't see the wood for the trees.
I want to find out the status of the Windows Genuine Advantage.
This should indirectly let me know that Windows has been activated, and thus that the network drivers have been loaded and are working.
This is for new systems which leave my desk. I already know the status of the system really, but in 6 months time when a customer says that the Netork has never worked, I can send him the proof!
Anyway, the code snippet which I can not for the life of me get to work is:
strcpy $GUID '{55c92734-d682-4d71-983e-d6ec3f16059f}'
system::Call 'SLWGA::SLIsGenuineLocal (*g.$GUID, *i.r0, n) i.r1'
messagebox mb_ok "WGA status: $0 :: $1"
Any ideas of what I am doing wrong?
your help is appreciated beyond measure.
Mark
Checking WGA status
9 posts
System::Call `Slwga::SLIsGenuineLocal(g '{55c92734-d682-4d71-983e-d6ec3f16059f}', *i.r0, i 0) i.r1`StuOh Stu thankyou!
I did try placing the GUID there rather than a pointer to it, but I just couldn't make the damn thing work.
Thanks so much
Mark
I did try placing the GUID there rather than a pointer to it, but I just couldn't make the damn thing work.
Thanks so much
Mark
Unless you are the one activating you have to remember that activation can be done over the phone and in the old days at least; by using a modem!
The g type should be thought of as a REFGUID in c++. Each parameter consists of 3 things, the type, the input and the output. The type should always be specified so you cannot use n alone. "Type.Something" actually means no input and put the output in Something. The input can be any variable but it should be quoted when using NSIS variables directly. The output (if required) however can only be s (push to stack) or one of the system registers (r0..r9).
The g type should be thought of as a REFGUID in c++. Each parameter consists of 3 things, the type, the input and the output. The type should always be specified so you cannot use n alone. "Type.Something" actually means no input and put the output in Something. The input can be any variable but it should be quoted when using NSIS variables directly. The output (if required) however can only be s (push to stack) or one of the system registers (r0..r9).
Thanks Anders
I didn't thnk of quoting the NSIS variable, and I was under the impression that the input had to be pointer to the GUID.
Still, Now that Stu has it working for me, I'll play about with it and try to learn from it.
Thanks guys.
I didn't thnk of quoting the NSIS variable, and I was under the impression that the input had to be pointer to the GUID.
Still, Now that Stu has it working for me, I'll play about with it and try to learn from it.
Thanks guys.
Technically it is a pointer to the GUID under the hood but the syntax for GUIDs is a bit weird. Another problem with your code is that you put a . after the g so no matter what you did the function would never get your GUID as its input.Originally Posted by SADiE View PostI didn't thnk of quoting the NSIS variable, and I was under the impression that the input had to be pointer to the GUID.
I am the guy setting these computers up, so the phone in doesn't come into it. Modem 🙂
Dotting the GUID (.) was a typo.. I had previously (*g $GUID) but without the quotes the paramater wasn't passed.
I think I understand this now.
All of these below work now that I quote the variable, but which is best practice for the quote ' ' or " "?
Also in the last one I pass n as null for the 3rd parameter, which is the same as i 0 right? I don't care about about a dialogue box as I don't want to display one.
MSDN:
pAppId [in]
A pointer to an SLID structure that specifies the application to check.
pGenuineState [out]
A pointer to a value of the SL_GENUINE_STATE enumeration that specifies the state of the installation.
pUIOptions [in, out, optional]
A pointer to an SL_NONGENUINE_UI_OPTIONS structure that specifies a dialog box to display if the installation is not genuine. If the value of this parameter is NULL, no
CODE Snippet:
# Determin if Windows Genuine Advantage has decided if the computer has been licensed.
strcpy $GUID "{55c92734-d682-4d71-983e-d6ec3f16059f}"
# System::Call `Slwga::SLIsGenuineLocal(g '{55c92734-d682-4d71-983e-d6ec3f16059f}', *i.r0, i 0) i.r1`
System::Call `Slwga::SLIsGenuineLocal(g '$GUID', *i.r0, i 0) i.r1`
System::Call `Slwga::SLIsGenuineLocal(g "$GUID", *i.r2, i 0) i.r3`
System::Call `Slwga::SLIsGenuineLocal(g '$GUID', *i.r4, n) i.r5`
messagebox mb_ok "WGA status: $0 :: $1"
messagebox mb_ok "WGA status: $2 :: $3"
messagebox mb_ok "WGA status: $4 :: $5"
Dotting the GUID (.) was a typo.. I had previously (*g $GUID) but without the quotes the paramater wasn't passed.
I think I understand this now.
All of these below work now that I quote the variable, but which is best practice for the quote ' ' or " "?
Also in the last one I pass n as null for the 3rd parameter, which is the same as i 0 right? I don't care about about a dialogue box as I don't want to display one.
MSDN:
pAppId [in]
A pointer to an SLID structure that specifies the application to check.
pGenuineState [out]
A pointer to a value of the SL_GENUINE_STATE enumeration that specifies the state of the installation.
pUIOptions [in, out, optional]
A pointer to an SL_NONGENUINE_UI_OPTIONS structure that specifies a dialog box to display if the installation is not genuine. If the value of this parameter is NULL, no
CODE Snippet:
# Determin if Windows Genuine Advantage has decided if the computer has been licensed.
strcpy $GUID "{55c92734-d682-4d71-983e-d6ec3f16059f}"
# System::Call `Slwga::SLIsGenuineLocal(g '{55c92734-d682-4d71-983e-d6ec3f16059f}', *i.r0, i 0) i.r1`
System::Call `Slwga::SLIsGenuineLocal(g '$GUID', *i.r0, i 0) i.r1`
System::Call `Slwga::SLIsGenuineLocal(g "$GUID", *i.r2, i 0) i.r3`
System::Call `Slwga::SLIsGenuineLocal(g '$GUID', *i.r4, n) i.r5`
messagebox mb_ok "WGA status: $0 :: $1"
messagebox mb_ok "WGA status: $2 :: $3"
messagebox mb_ok "WGA status: $4 :: $5"
`` , '' and "" quotes are treated the same way.
If you look at the System plugin readme you see that n is listed under "Available Sources and Destinations" and not under "Available Parameter Types". While it does seem to accept n as a type it is not correct syntax and another problem is that we don't know how large n is if it had been a type (it is probably pointer sized but I don't know for sure).
The size is important. On 32-bit windows, a call to MyFunc(INT64 myparam) ends up as:
If you look at the System plugin readme you see that n is listed under "Available Sources and Destinations" and not under "Available Parameter Types". While it does seem to accept n as a type it is not correct syntax and another problem is that we don't know how large n is if it had been a type (it is probably pointer sized but I don't know for sure).
The size is important. On 32-bit windows, a call to MyFunc(INT64 myparam) ends up as:
push hi32so System::Call whatever::MyFunc(n) would probably crash because it only pushed 32 of the required 64 bits...
push lo32
call MyFunc
Cool. Thanks Anders.