Remove registry stub

With latest changes to PowerShell source code, and better behaviors of
Get/Set-ExecutionPolicy, the Windows registry API stub can be removed.
This commit is contained in:
Andrew Schwartzmeyer
2016-02-09 16:10:10 -08:00
parent 5442346820
commit fcb2ce6d71
6 changed files with 0 additions and 49 deletions
-8
View File
@@ -59,14 +59,6 @@ Multiple sessions are not yet supported
Server shut-down is not complete (must restart `omiserver` after a session is
completed.
## Registry Use
`SafeHandle` objects attempt to use the registry (even on Linux) so a stub is
in place to prevent error messages. This should be fixed in .NET Core. Use of
the registry is widespread throughout the PowerShell codebase, and so innocuous
things (such as loading particular modules) can cause strange behavior when
unguarded code is executed.
## Unavailable cmdlets
This project includes the CoreCLR versions of the `Commands.Management`,
-7
View File
@@ -27,13 +27,6 @@ mkdir -p $BIN/Modules
cp src/libpsl-native.* $BIN
)
# Build registry stub (this should go away, again)
(
cd src/registry-stub
make
cp api-ms-win-core-registry-l1-1-0.dll $BIN
)
# Publish PowerShell
(
cd src/Microsoft.PowerShell.Linux.Host
-1
View File
@@ -1 +0,0 @@
api-ms-win-core-registry-l1-1-0.dll
-2
View File
@@ -1,2 +0,0 @@
api-ms-win-core-registry-l1-1-0.dll: api-ms-win-core-registry-l1-1-0.c
gcc -o $@ -fPIC -shared -Wall $^
-20
View File
@@ -1,20 +0,0 @@
This stubs the `RegCloseKey` function provided on Windows by
`api-ms-win-core-registry-l1-1-0.dll`.
Without this DLL in the library path, the following exception is
thrown upon shutdown of PowerShell. While I do not like hiding this
error, it is neccesary for the rest of PowerShell to shutdown
properly, and release its file descriptors. Otherwise the shell will
mess up Bash, and it needs to be reset.
This must be removed as soon as it can be addressed in a better way.
```
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-registry-l1-1-0.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Interop.mincore.RegCloseKey(IntPtr hKey)
at Microsoft.Win32.SafeHandles.SafeRegistryHandle.ReleaseHandle()
at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
at System.Runtime.InteropServices.SafeHandle.Finalize()
```
@@ -1,11 +0,0 @@
#include <stdint.h>
int32_t RegOpenKeyExW(void* hKey,uint16_t* lpSubKey,uint32_t ulOptions,uint32_t samDesired,void* phkResult)
{
return 1;
}
int32_t RegCloseKey(void* handle)
{
return 0;
}