XPInstall API Reference - WinRegValue- is it implemented?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

XPInstall API Reference - WinRegValue- is it implemented?

gmgj
its documented here

http://developer.mozilla.org/en/docs/XPInstall_API_Reference:WinReg_Object:WinRegValue

there is a struct and other jazz here

C:\moz\mozilla\xpinstall\src\nsWinRegValue.h
C:\moz\mozilla\xpinstall\src\nsWinRegEnums.h

 nsWinRegValue(PRInt32 datatype, void* regdata, PRInt32 len)
{
    type        = datatype;
    data        = regdata;
    data_length = len;
}


This appears related,
C:\moz\mozilla\xpinstall\src\nsWinReg.h

This looks like the core of the install JS jazz
C:\moz\mozilla\xpinstall\src\nsJSWinReg.cpp

I do not see WinRegValue implemented

this code in an install.js
...
  var wintxt = new Array(256);

  var winreg = getWinRegistry();

  if(winreg != null)
  {
    winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
    subkey  =  "SYSTEM\\CurrentControlSet\\Control\\Session
Manager\\Environment" ;
    valname = "Path"; // is a REG_EXPAND_SZ
    regValue = WinRegValue(2, wintxt, 256)
    regValue = WinRegValue.getValue(subkey, valname);

  }

 logComment(regValue.datatype);
...

gets this:
Error: WinRegValue is not defined
Source File:
Line: 276

_______________________________________________
dev-tech-xpinstall mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpinstall
Reply | Threaded
Open this post in threaded view
|

Re: XPInstall API Reference - WinRegValue- is it implemented?

Karsten Düsterloh
gmgj aber hob zu reden an und schrieb:
> I do not see WinRegValue implemented

So it seems. While WinReg's getValue at least returns a (useless for JS)
pointer value, setValue is just a stub function that does nothing. :(
http://landfill.mozilla.org/mxr-test/mozilla/source/xpinstall/src/nsJSWinReg.cpp#603

> this code in an install.js
> ...
>   var wintxt = new Array(256);
>
>   var winreg = getWinRegistry();
>
>   if(winreg != null)
>   {
>     winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
>     subkey  =  "SYSTEM\\CurrentControlSet\\Control\\Session
> Manager\\Environment" ;
>     valname = "Path"; // is a REG_EXPAND_SZ
>     regValue = WinRegValue(2, wintxt, 256)
>     regValue = WinRegValue.getValue(subkey, valname);

The last two lines wouldn't make much sense even if WinRegValue was
implemented.


Karsten
--
Feel free to correct my English. :)
_______________________________________________
dev-tech-xpinstall mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpinstall
Reply | Threaded
Open this post in threaded view
|

Re: XPInstall API Reference - WinRegValue- is it implemented?

gmgj
You are correct,

this is sort of close to what I thought you would do to create a
WinRegValue
     regValue = WinRegValue(2, wintxt, 256)

this is more like what the call would be like, if it was implemented
like the doc

     regValue = winreg.getValue ( String subkey, String valname);

maybe I should have been a little suspicious of the doc.

Javascript with int and byte ?

WinRegValue ( int datatype, byte[] regdata);

Thanks for confirming this for me.


Karsten Düsterloh wrote:

> gmgj aber hob zu reden an und schrieb:
> > I do not see WinRegValue implemented
>
> So it seems. While WinReg's getValue at least returns a (useless for JS)
> pointer value, setValue is just a stub function that does nothing. :(
> http://landfill.mozilla.org/mxr-test/mozilla/source/xpinstall/src/nsJSWinReg.cpp#603
>
> > this code in an install.js
> > ...
> >   var wintxt = new Array(256);
> >
> >   var winreg = getWinRegistry();
> >
> >   if(winreg != null)
> >   {
> >     winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
> >     subkey  =  "SYSTEM\\CurrentControlSet\\Control\\Session
> > Manager\\Environment" ;
> >     valname = "Path"; // is a REG_EXPAND_SZ
> >     regValue = WinRegValue(2, wintxt, 256)
> >     regValue = WinRegValue.getValue(subkey, valname);
>
> The last two lines wouldn't make much sense even if WinRegValue was
> implemented.
>
>
> Karsten
> --
> Feel free to correct my English. :)

_______________________________________________
dev-tech-xpinstall mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpinstall