MCPcopy Create free account
hub / github.com/nodejs/node / _RegistryQuery

Function _RegistryQuery

tools/gyp/pylib/gyp/MSVSVersion.py:192–217  ·  view source on GitHub ↗

r"""Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP through KB patch 9

(key, value=None)

Source from the content-addressed store, hash-verified

190
191
192def _RegistryQuery(key, value=None):
193 r"""Use reg.exe to read a particular key through _RegistryQueryBase.
194
195 First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If
196 that fails, it falls back to System32. Sysnative is available on Vista and
197 up and available on Windows Server 2003 and XP through KB patch 942589. Note
198 that Sysnative will always fail if using 64-bit python due to it being a
199 virtual directory and System32 will work correctly in the first place.
200
201 KB 942589 - http://support.microsoft.com/kb/942589/en-us.
202
203 Arguments:
204 key: The registry key.
205 value: The particular registry value to read (optional).
206 Return:
207 stdout from reg.exe, or None for failure.
208 """
209 text = None
210 try:
211 text = _RegistryQueryBase("Sysnative", key, value)
212 except OSError as e:
213 if e.errno == errno.ENOENT:
214 text = _RegistryQueryBase("System32", key, value)
215 else:
216 raise
217 return text
218
219
220def _RegistryGetValueUsingWinReg(key, value):

Callers 1

_RegistryGetValueFunction · 0.85

Calls 1

_RegistryQueryBaseFunction · 0.85

Tested by

no test coverage detected