mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
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:
1 parent
5442346820
commit
fcb2ce6d71
6 files changed
-49
No files matched your search
@@ -59,14 +59,6 @@ Multiple sessions are not yet supported
|
|||||||
Server shut-down is not complete (must restart `omiserver` after a session is
|
Server shut-down is not complete (must restart `omiserver` after a session is
|
||||||
completed.
|
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
|
## Unavailable cmdlets
|
||||||
|
|
||||||
This project includes the CoreCLR versions of the `Commands.Management`,
|
This project includes the CoreCLR versions of the `Commands.Management`,
|
||||||
|
|||||||
@@ -27,13 +27,6 @@ mkdir -p $BIN/Modules
|
|||||||
cp src/libpsl-native.* $BIN
|
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
|
# Publish PowerShell
|
||||||
(
|
(
|
||||||
cd src/Microsoft.PowerShell.Linux.Host
|
cd src/Microsoft.PowerShell.Linux.Host
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
api-ms-win-core-registry-l1-1-0.dll
|
|
||||||
@@ -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 $^
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user