Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 40300 Details for
Bug 140079
enhance org.eclipse.cdt.utils.WindowsRegistry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch to WindowsRegistry
WinReg_Patch.TXT (text/plain), 2.52 KB, created by
Ling Wang
on 2006-05-03 16:51:32 EDT
(
hide
)
Description:
patch to WindowsRegistry
Filename:
MIME Type:
Creator:
Ling Wang
Created:
2006-05-03 16:51:32 EDT
Size:
2.52 KB
patch
obsolete
>Index: WindowsRegistry.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/WindowsRegistry.java,v >retrieving revision 1.2 >diff -u -r1.2 WindowsRegistry.java >--- WindowsRegistry.java 3 Apr 2006 14:12:03 -0000 1.2 >+++ WindowsRegistry.java 7 Apr 2006 02:21:35 -0000 >@@ -44,4 +44,15 @@ > */ > public native String getLocalMachineValue(String subkey, String name); > >+ /** >+ * Given a subkey of HKEY_LOCAL_MACHINE, and an index (starting from 0) >+ * to the key's array of values, return the name of the indexed value. >+ * The return value is null on any error or when the index is invalid. >+ * The value name can be used in the above getLocalMachineValue() to retrieve >+ * the value data. >+ * @param subkey subkey of HKEY_LOCAL_MACHINE >+ * @param index index to the subkey's array of values, starting from 0. >+ * @return name of registry value or null if not found >+ */ >+ public native String getLocalMachineValueName(String subkey, int index); > } > >Index: winreg.cpp >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.core.win32/library/winreg.cpp,v >retrieving revision 1.2 >diff -u -r1.2 winreg.cpp >--- winreg.cpp 3 Apr 2006 14:12:04 -0000 1.2 >+++ winreg.cpp 7 Apr 2006 02:45:01 -0000 >@@ -28,3 +28,43 @@ > > return result; > } >+ >+/* >+ * Given a subkey (string) under HKEY_LOCAL_MACHINE, and an index (starting from 0) >+ * to the key's array of values, return the name of the indexed value. >+ * The return value is null on any error or when the index is invalid. >+ */ >+ >+extern "C" >+JNIEXPORT jstring Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValueName( >+ JNIEnv * env, jobject obj, jstring subkey, jint index) >+{ >+ const jchar * csubkey = env->GetStringChars(subkey, NULL); >+ jstring result = NULL; >+ >+ HKEY key; >+ LONG rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, (const wchar_t *)csubkey, 0, KEY_READ, &key); >+ if (rc != ERROR_SUCCESS) >+ return NULL; >+ >+ wchar_t valueName[256]; >+ DWORD nameSize = sizeof(valueName) + 2; >+ >+ rc = RegEnumValue(key, index, >+ valueName, // UNICODE string >+ &nameSize, >+ NULL, NULL, >+ NULL, // data string >+ NULL); // size in BYTE of data. >+ >+ if (rc == ERROR_SUCCESS) >+ { >+ result = env->NewString((jchar *)valueName, nameSize); >+ } >+ >+ RegCloseKey(key); >+ >+ env->ReleaseStringChars(subkey, csubkey); >+ >+ return result; >+} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 140079
:
40300
|
40506