Closed
Bug 237754
Opened 20 years ago
Closed 20 years ago
reintroduce getRegistryEntry
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bugzilla, Assigned: bugzilla)
References
()
Details
(Whiteboard: fixed0.9)
Attachments
(1 file, 5 obsolete files)
2.81 KB,
patch
|
dave532
:
review+
|
Details | Diff | Splinter Review |
My extension Launchy: http://gemal.dk/mozilla/launchy.html which enables users to open webpages and mailto with external applications is using the getRegistryEntry function. This function used to be part of winhooks. It seems that winhooks has been completely killed with Mozilla Firefox. This has also killed off Launchy on Mozilla Firefox. I desperatly need getRegistryEntry on Mozilla Firefox for Launchy to work. Is there a chance that getRegistryEntry could be reintroduced? all the code is already there since I dont need any new functionality. I just need the function to be accessable from Mozilla Firefox. Perhaps from the @mozilla.org/browser/shell-service;1 object? For my extension this is a complete blocker....:(
Assignee | ||
Comment 1•20 years ago
|
||
one additional file is needed. nsWindowsShellServiceUtil.cpp
Assignee | ||
Comment 2•20 years ago
|
||
Assignee: bugs → bugzilla
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•20 years ago
|
||
I've tested it in my own compiled build of Mozilla Firefox and it works. Need feedback
Assignee | ||
Comment 4•20 years ago
|
||
Comment on attachment 145534 [details] [diff] [review] first cut Ben: could you look at the patch. There's also a new file called nsWindowsShellServiceUtil.cpp attached to the bug. That's needed to compile.
Attachment #145534 -
Flags: review?(bugs)
Assignee | ||
Updated•20 years ago
|
Attachment #145534 -
Flags: review?(bugs) → review?(firefox)
Assignee | ||
Updated•20 years ago
|
Attachment #145534 -
Flags: review?(firefox) → review?(bryner)
Comment 5•20 years ago
|
||
Hi Henrik, I'll look at this later tonight. I have some concerns about API that I'd like to think about.
Assignee | ||
Comment 7•20 years ago
|
||
(In reply to comment #6) > I wonder why this was removed. Btw, is there a bug # for this removal? winhooks got removed in bug 236744 I then filed bug 237617 about the missing getRegistryEntry
Comment 8•20 years ago
|
||
Comment on attachment 145534 [details] [diff] [review] first cut There's no need for a new file, nor a need to add back any of the old excessively complex code. No structs, no classes, no byzantine object structure, just some good ol' fashioned Windows C code. Simply add a method to nsIWindowsShellService called getRegistryEntry that takes a string key name and a value name, so you can call: var val = wss.getRegistryEntry("HKEY_CURRENT_USER\\blah\\blah\\blah\\", "val");
Attachment #145534 -
Flags: review?(bryner) → review-
Assignee | ||
Comment 9•20 years ago
|
||
Hmm... I'm no C++ coder so I could really really need some help here. Ben, do you have time to look at it? Can anybody with interest in this bug, help me?
Comment 10•20 years ago
|
||
gemal, what about the existing: nsIWindowsRegistry getRegistryEntry()? see http://lxr.mozilla.org/seamonkey/source/xpfe/components/winhooks/nsIWindowsHooks.idl#231
Comment 11•20 years ago
|
||
I miss Launchy, so I figured I'd give this a shot. This patch is basically a knockoff of the code Seth pointed out, simplified a little. It compiles and seems to put Launchy back in working order (at least it does on my WinXP system). It keeps the API the same as it used to be, rather than changing it to resemble what Ben mentioned, since I don't see why extensions should have to special-case Firefox in their code.
Comment 12•20 years ago
|
||
Comment on attachment 146203 [details] [diff] [review] Proposed patch How does this look, Ben?
Attachment #146203 -
Flags: review?(bugs)
Comment 13•20 years ago
|
||
Comment on attachment 146203 [details] [diff] [review] Proposed patch You beat me to this, I was just about to give this a shot! You've taken the same approach as I would as it seems the simplest way to implement things to me. >+ >+ LONG rv = ::RegOpenKey( baseKey, aSubKeyName, &key ); RegOpenKey is depreciated, according to MSDN it's for compatibility with 16 bit apps only. Use RegOpenKeyEx instead: LONG rv = ::RegOpenKeyEx( baseKey, aSubKeyName, 0, KEY_READ, &key ); http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/r egopenkeyex.asp
Comment 14•20 years ago
|
||
As I nearly finished here's my patch anyway, basically similar to the earlier one, but with RegOpenKeyEx rather than RegOpenKey (see my previous comment). If this gets checked in credit should goto Jon Henry as he did post his patch first which is almost identical bar the call to RegOpenKey. The original winhooks code uses RegOpenKey too, perhaps I should file a bug for seamonkey to replace it with RegOpenKeyEx there as well? Dave
Attachment #145534 -
Attachment is obsolete: true
Attachment #145535 -
Attachment is obsolete: true
Comment 15•20 years ago
|
||
I would have a question. Does getRegistryEntry compromise security? I mean, can this function be accessed via Javascript from a web page?
Comment 16•20 years ago
|
||
OK, forgot to declare one of the variables I was using! Here's the fixed version. On a bit of a tangent but vaguely related I've had a look and bug 216388 is the bug that describes the issue of using RegOpenKey in Seamonkey
Attachment #146218 -
Attachment is obsolete: true
Comment 17•20 years ago
|
||
(In reply to comment #15) > I would have a question. Does getRegistryEntry compromise security? I mean, can > this function be accessed via Javascript from a web page? By default chrome apps (anything accessible via chrome:// url's - e.g. extensions and the app itself) have a higher level of access than normal web pages or locally saved HTML files. getRegistryEntry is not exposed to non-prililedged code. http://www.mozilla.org/projects/security/components/reviewguide.html
Comment 18•20 years ago
|
||
why not use the existing, scriptable, nsIWindowsRegistry interface? I think you can get the winhooks service and QI to it. (for launchy, you could do that in js) If the existing code in nsWindowsHooks::GetRegistryEntry() isn't right, we should just fix it.
Comment 19•20 years ago
|
||
(In reply to comment #18) > why not use the existing, scriptable, nsIWindowsRegistry interface? The problem is that in Firefox winhooks has been replaced with the shell service which is designed to be a cross platform equivalent of winhooks. > I think you can get the winhooks service and QI to it. (for launchy, you could > do that in js) That's what he used to do > > If the existing code in nsWindowsHooks::GetRegistryEntry() isn't right, we > should just fix it. I guess a solution that'd fit the needs of both seamonkey and firefox would be a good idea
Comment 20•20 years ago
|
||
Comment on attachment 146227 [details] [diff] [review] Forgot to declare 'rv'! (supercedes my previous patch) Fix the indentation: >+NS_IMETHODIMP >+nsWindowsShellService::GetRegistryEntry( PRInt32 aHKEYConstant, const char *aSubKeyName, const char *aValueName, char **aResult ) { >+ >+ HKEY hKey, fullKey; >+ >+ *aResult = 0; >+ // Calculate HKEY_* base key >+ switch (aHKEYConstant) { >+ case HKCR: >+ hKey = HKEY_CLASSES_ROOT; >+ break; >+ case HKCC: >+ hKey = HKEY_CURRENT_CONFIG; >+ break; etc (line cases up with switch, only 2 spaces for each sub block) and r=ben@mozilla.org
Attachment #146227 -
Flags: review+
Assignee | ||
Updated•20 years ago
|
Attachment #146227 -
Flags: superreview?(firefox)
Comment 21•20 years ago
|
||
Fixed the indentation as per Ben's comments
Attachment #146203 -
Attachment is obsolete: true
Attachment #146227 -
Attachment is obsolete: true
Comment 22•20 years ago
|
||
Comment on attachment 146338 [details] [diff] [review] Patch addressing Ben's comments Carrying over the r= from Ben
Attachment #146338 -
Flags: review+
Attachment #146203 -
Flags: review?(bugs)
Comment 23•20 years ago
|
||
Changes that affect Firefox only don't need super-review.
Assignee | ||
Comment 24•20 years ago
|
||
Ben: could you check the patch in?
Updated•20 years ago
|
Attachment #146227 -
Flags: superreview?(firefox)
Assignee | ||
Comment 25•20 years ago
|
||
the changes in the bug are Firefox only. Could anybody check this in? I really really like to get it into Firefox 1.0
Assignee | ||
Comment 26•20 years ago
|
||
David: where does the NS_INVALID_ARG come from. I seems to have problem with that? Did it compile with you?
Assignee | ||
Comment 27•20 years ago
|
||
it should be: NS_ERROR_INVALID_ARG could you make a new patch?
Comment 28•20 years ago
|
||
checked in (I did some formatting cleanup on it, and fixed the INVALID_ARG thing)
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 29•20 years ago
|
||
Bug thanx to David Hallowell! Launchy will now be able to work with latest builds. I've filed a new bug to improve the function: http://bugzilla.mozilla.org/show_bug.cgi?id=241237
Status: RESOLVED → VERIFIED
Comment 30•20 years ago
|
||
reopening for the moment, will reclose once this lands on the 0.9 branch (probably tomorrow)
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Whiteboard: checkin0.9
Comment 31•20 years ago
|
||
checked in on the 1.7 branch at 2004-04-25 12:43
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Whiteboard: checkin0.9 → fixed0.9
Assignee | ||
Comment 32•20 years ago
|
||
> checked in on the 1.7 branch
what do you mean? Mozilla 1.x already has getRegistryEntry!!!
Comment 33•20 years ago
|
||
I think they mean Firefox builds that are built off the 1.7 branch rather than the Mozilla trunk. AFAIK 0.9 and 1.0 will be built off this stable branch.
You need to log in
before you can comment on or make changes to this bug.
Description
•