-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added IPC Wrapper For C# #1597
Merged
Merged
Added IPC Wrapper For C# #1597
Changes from 4 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
2b91903
Fixed one mishandled case when computing zones (#1470)
ivan100sic 141b635
Fix spelling mistake (#1476)
1cf8634
Move ZoneSetPersistedDataOLD to JsonHelpers (#1405)
stefansjfw bea8e64
Remove unused check for pClassFactory (#1419)
f6047b8
Switch WindowWalker C# project to use PackageReference (#1374)
wjk 52e08a2
Update bundle.js and html index files. (#1502)
enricogior 5581e25
Editor IO exception handling (#1491)
stefansjfw 7e1f7bd
Ui rename Zone highlight Opacity (%) - > Zone Opacity (#1504)
PrzemyslawTusinski 7653d5f
Document fancy zones (#1496)
vldmr11080 6379c32
added in dialog, tweaked layout to be more resiliant to longer text (…
crutkas 965b098
Fix deleting custom layouts when closing on SaveApply (#1512)
stefansjfw 7ac378d
Fix compiler warning (#1492)
stefansjfw 4dbe535
Use default options for Utf8JsonWriter (#1497)
stefansjfw 013a58e
Move window to last known zone. Support movement in multi-monitor sce…
vldmr11080 197bc54
FancyZones editor magnetic snapping effect (#1503)
ivan100sic 852689b
Now working on 0.15.3 (#1525)
enricogior 4632224
Fixed a Grid editor issue (#1308)
ivan100sic 83901e5
Improve readability of EditorWindow (#1515)
stefansjfw f170cef
Create NOTICE.md
crutkas 83ce8a2
[0.16]: Merge Preview Handlers in Master (#1516)
udit3333 bd2cf19
Updated build definition link in readme (#1542)
udit3333 20e89f2
runner: only launch update threads when we know we won't be elevated …
yuyoyuppe 7f12288
Remove Constants from Debug config (#1549)
udit3333 d84cc37
Merge ImageResizer into master (#1469)
arjunbalgovind 3e267bc
simplifying CoC and point to CoCmd
crutkas 398b7a5
MSIX: add debug configuration option for package building (#1561)
yuyoyuppe 4c1dfba
Run unit tests in CI (#1568)
SeraphimaZykova 0ac6c01
runner: simplify powertoy_module interface (#1560)
yuyoyuppe 0af6348
Fancy zones: show active layouts on all monitors (#1553)
PrzemyslawTusinski 8c17d82
moving the license.rtf file out of the root dir. compiled both msix …
crutkas 969d71b
Fix for build break (#1573)
enricogior 04027b9
Temporarily removed a test with huge running time on Azure (#1591)
ivan100sic 02857d1
Some refactoring of FancyZones::IsInterestingWindow and added Unit Te…
yevhenii44-zz 97e98d2
Remove failing Svg Preview Handler Unit Tests in CI (#1583)
udit3333 96a7e4f
disable unit tests in CI (#1592)
enricogior 2cc6d2e
Fixed some compiler warnings (#1577)
ivan100sic 1fc6798
Bump acorn from 5.7.3 to 5.7.4 in /src/settings-web (#1588)
dependabot[bot] 437303e
added IPC wrapper
d7b77b1
removed ARM X86 and Any CPU configs
f49727e
Invalid json test cases + strings validation (#1558)
SeraphimaZykova d8c1cb2
fix for #1595 (#1598)
crutkas 0ccc8ff
fixed formating and removed warning as erros
7146416
treat warning as errors
72eb761
Fixed issue with autostarting as admin even if it should as user, fix…
PrzemyslawTusinski 419fc15
WinAppDriver tests (#1371)
SeraphimaZykova fd5518a
added comments
535ee72
removed debug outputs
98ed178
Double-qoute the paths when passing them as cmd args (#1604)
stefansjfw 0633133
updated comments
3de6664
Merge branch 'master' of https://github.com/microsoft/PowerToys into …
28727ee
Revert "removed debug outputs"
6ea54da
Merge branch 'user/lamotile/add_ipc_csharp' of https://github.com/mic…
0430e41
Merge branch 'dev/settingsV2' into user/lamotile/add_ipc_csharp
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
210 changes: 210 additions & 0 deletions
210
...crosoft.PowerToys.Settings.IPCWrapperPS/Microsoft.PowerToys.Settings.IPCWrapperPS.vcxproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<VCProjectVersion>16.0</VCProjectVersion> | ||
<ProjectGuid>{C073B057-B157-40F0-8678-1DCD119D841C}</ProjectGuid> | ||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | ||
<Keyword>AtlPSProj</Keyword> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v142</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v142</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v142</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v142</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="Shared"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<IntDir>$(Configuration)PS\</IntDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<IntDir>$(Configuration)PS\</IntDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<IntDir>$(Configuration)PS\</IntDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<IntDir>$(Configuration)PS\</IntDir> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<ClCompile> | ||
<PreprocessorDefinitions>REGISTER_PROXY_DLL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
</ClCompile> | ||
<Link> | ||
<AdditionalDependencies>kernel32.lib;rpcns4.lib;rpcrt4.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<ModuleDefinitionFile>Microsoft.PowerToys.Settings.IPCWrapperPS.def</ModuleDefinitionFile> | ||
<RegisterOutput>true</RegisterOutput> | ||
</Link> | ||
<PreBuildEvent> | ||
<Command>if exist dlldata.c goto :END | ||
echo Error: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project. | ||
Exit 1 | ||
:END | ||
</Command> | ||
<Message>Checking for required files</Message> | ||
</PreBuildEvent> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<ClCompile> | ||
<PreprocessorDefinitions>WIN32;REGISTER_PROXY_DLL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
</ClCompile> | ||
<Link> | ||
<AdditionalDependencies>kernel32.lib;rpcns4.lib;rpcrt4.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<ModuleDefinitionFile>Microsoft.PowerToys.Settings.IPCWrapperPS.def</ModuleDefinitionFile> | ||
<RegisterOutput>true</RegisterOutput> | ||
</Link> | ||
<PreBuildEvent> | ||
<Command>if exist dlldata.c goto :END | ||
echo Error: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project. | ||
Exit 1 | ||
:END | ||
</Command> | ||
<Message>Checking for required files</Message> | ||
</PreBuildEvent> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<ClCompile> | ||
<PreprocessorDefinitions>WIN32;REGISTER_PROXY_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<Optimization>MaxSpeed</Optimization> | ||
</ClCompile> | ||
<Link> | ||
<AdditionalDependencies>kernel32.lib;rpcns4.lib;rpcrt4.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<ModuleDefinitionFile>Microsoft.PowerToys.Settings.IPCWrapperPS.def</ModuleDefinitionFile> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<RegisterOutput>true</RegisterOutput> | ||
</Link> | ||
<PreBuildEvent> | ||
<Command>if exist dlldata.c goto :END | ||
echo Error: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project. | ||
Exit 1 | ||
:END | ||
</Command> | ||
<Message>Checking for required files</Message> | ||
</PreBuildEvent> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<ClCompile> | ||
<PreprocessorDefinitions>REGISTER_PROXY_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<Optimization>MaxSpeed</Optimization> | ||
</ClCompile> | ||
<Link> | ||
<AdditionalDependencies>kernel32.lib;rpcns4.lib;rpcrt4.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<ModuleDefinitionFile>Microsoft.PowerToys.Settings.IPCWrapperPS.def</ModuleDefinitionFile> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<RegisterOutput>true</RegisterOutput> | ||
</Link> | ||
<PreBuildEvent> | ||
<Command>if exist dlldata.c goto :END | ||
echo Error: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project. | ||
Exit 1 | ||
:END | ||
</Command> | ||
<Message>Checking for required files</Message> | ||
</PreBuildEvent> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<None Include="..\src\core\Microsoft.PowerToys.Settings.IPCWrapper\Microsoft.PowerToys.Settings.IPCWrapperps.def" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\src\core\Microsoft.PowerToys.Settings.IPCWrapper\dlldata.c"> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
</PrecompiledHeader> | ||
</ClCompile> | ||
<ClCompile Include="..\src\core\Microsoft.PowerToys.Settings.IPCWrapper\MicrosoftPowerToysSettingsIPCWrapper_i.c"> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
</PrecompiledHeader> | ||
</ClCompile> | ||
<ClCompile Include="..\src\core\Microsoft.PowerToys.Settings.IPCWrapper\MicrosoftPowerToysSettingsIPCWrapper_p.c"> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged> | ||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
</PrecompiledHeader> | ||
</ClCompile> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
37 changes: 37 additions & 0 deletions
37
...PowerToys.Settings.IPCWrapperPS/Microsoft.PowerToys.Settings.IPCWrapperPS.vcxproj.filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Generated Files"> | ||
<UniqueIdentifier>{48f2eb30-48be-400a-88ce-8f93929d29c8}</UniqueIdentifier> | ||
<SourceControlFiles>False</SourceControlFiles> | ||
</Filter> | ||
<Filter Include="Source Files"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="Header Files"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="..\src\core\Microsoft.PowerToys.Settings.IPCWrapper\Microsoft.PowerToys.Settings.IPCWrapperps.def"> | ||
<Filter>Source Files</Filter> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\src\core\Microsoft.PowerToys.Settings.IPCWrapper\MicrosoftPowerToysSettingsIPCWrapper_i.c"> | ||
<Filter>Generated Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="..\src\core\Microsoft.PowerToys.Settings.IPCWrapper\MicrosoftPowerToysSettingsIPCWrapper_p.c"> | ||
<Filter>Generated Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="..\src\core\Microsoft.PowerToys.Settings.IPCWrapper\dlldata.c"> | ||
<Filter>Generated Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
</Project> |
72 changes: 72 additions & 0 deletions
72
src/core/Microsoft.PowerToys.Settings.TwoWayIPCLib/TwoWayIPCLib.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// TwoWayIPCLib.cpp : Implementation of DLL Exports. | ||
|
||
|
||
#include "pch.h" | ||
#include "framework.h" | ||
#include "resource.h" | ||
#include "TwoWayIPCLib_i.h" | ||
#include "dllmain.h" | ||
|
||
using namespace ATL; | ||
|
||
// Used to determine whether the DLL can be unloaded by OLE. | ||
_Use_decl_annotations_ | ||
STDAPI DllCanUnloadNow(void) | ||
{ | ||
return _AtlModule.DllCanUnloadNow(); | ||
} | ||
|
||
// Returns a class factory to create an object of the requested type. | ||
_Use_decl_annotations_ | ||
STDAPI DllGetClassObject(_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID* ppv) | ||
{ | ||
return _AtlModule.DllGetClassObject(rclsid, riid, ppv); | ||
} | ||
|
||
// DllRegisterServer - Adds entries to the system registry. | ||
_Use_decl_annotations_ | ||
STDAPI DllRegisterServer(void) | ||
{ | ||
// registers object, typelib and all interfaces in typelib | ||
HRESULT hr = _AtlModule.DllRegisterServer(); | ||
return hr; | ||
} | ||
|
||
// DllUnregisterServer - Removes entries from the system registry. | ||
_Use_decl_annotations_ | ||
STDAPI DllUnregisterServer(void) | ||
{ | ||
HRESULT hr = _AtlModule.DllUnregisterServer(); | ||
return hr; | ||
} | ||
|
||
// DllInstall - Adds/Removes entries to the system registry per user per machine. | ||
STDAPI DllInstall(BOOL bInstall, _In_opt_ LPCWSTR pszCmdLine) | ||
{ | ||
HRESULT hr = E_FAIL; | ||
static const wchar_t szUserSwitch[] = L"user"; | ||
|
||
if (pszCmdLine != nullptr) | ||
{ | ||
if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0) | ||
{ | ||
ATL::AtlSetPerUserRegistration(true); | ||
} | ||
} | ||
|
||
if (bInstall) | ||
{ | ||
hr = DllRegisterServer(); | ||
if (FAILED(hr)) | ||
{ | ||
DllUnregisterServer(); | ||
} | ||
} | ||
else | ||
{ | ||
hr = DllUnregisterServer(); | ||
} | ||
|
||
return hr; | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
src/core/Microsoft.PowerToys.Settings.TwoWayIPCLib/TwoWayIPCLib.def
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; TwoWayIPCLib.def : Declares the module parameters. | ||
|
||
LIBRARY | ||
|
||
EXPORTS | ||
DllCanUnloadNow PRIVATE | ||
DllGetClassObject PRIVATE | ||
DllRegisterServer PRIVATE | ||
DllUnregisterServer PRIVATE | ||
DllInstall PRIVATE |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why include it?