Skip to content
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
53 commits merged into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
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 Mar 5, 2020
141b635
Fix spelling mistake (#1476)
Mar 6, 2020
1cf8634
Move ZoneSetPersistedDataOLD to JsonHelpers (#1405)
stefansjfw Mar 7, 2020
bea8e64
Remove unused check for pClassFactory (#1419)
Mar 8, 2020
f6047b8
Switch WindowWalker C# project to use PackageReference (#1374)
wjk Mar 8, 2020
52e08a2
Update bundle.js and html index files. (#1502)
enricogior Mar 9, 2020
5581e25
Editor IO exception handling (#1491)
stefansjfw Mar 9, 2020
7e1f7bd
Ui rename Zone highlight Opacity (%) - > Zone Opacity (#1504)
PrzemyslawTusinski Mar 9, 2020
7653d5f
Document fancy zones (#1496)
vldmr11080 Mar 9, 2020
6379c32
added in dialog, tweaked layout to be more resiliant to longer text (…
crutkas Mar 9, 2020
965b098
Fix deleting custom layouts when closing on SaveApply (#1512)
stefansjfw Mar 9, 2020
7ac378d
Fix compiler warning (#1492)
stefansjfw Mar 9, 2020
4dbe535
Use default options for Utf8JsonWriter (#1497)
stefansjfw Mar 9, 2020
013a58e
Move window to last known zone. Support movement in multi-monitor sce…
vldmr11080 Mar 10, 2020
197bc54
FancyZones editor magnetic snapping effect (#1503)
ivan100sic Mar 10, 2020
852689b
Now working on 0.15.3 (#1525)
enricogior Mar 10, 2020
4632224
Fixed a Grid editor issue (#1308)
ivan100sic Mar 10, 2020
83901e5
Improve readability of EditorWindow (#1515)
stefansjfw Mar 11, 2020
f170cef
Create NOTICE.md
crutkas Mar 11, 2020
83ce8a2
[0.16]: Merge Preview Handlers in Master (#1516)
udit3333 Mar 11, 2020
bd2cf19
Updated build definition link in readme (#1542)
udit3333 Mar 12, 2020
20e89f2
runner: only launch update threads when we know we won't be elevated …
yuyoyuppe Mar 12, 2020
7f12288
Remove Constants from Debug config (#1549)
udit3333 Mar 12, 2020
d84cc37
Merge ImageResizer into master (#1469)
arjunbalgovind Mar 12, 2020
3e267bc
simplifying CoC and point to CoCmd
crutkas Mar 12, 2020
398b7a5
MSIX: add debug configuration option for package building (#1561)
yuyoyuppe Mar 12, 2020
4c1dfba
Run unit tests in CI (#1568)
SeraphimaZykova Mar 13, 2020
0ac6c01
runner: simplify powertoy_module interface (#1560)
yuyoyuppe Mar 13, 2020
0af6348
Fancy zones: show active layouts on all monitors (#1553)
PrzemyslawTusinski Mar 13, 2020
8c17d82
moving the license.rtf file out of the root dir. compiled both msix …
crutkas Mar 13, 2020
969d71b
Fix for build break (#1573)
enricogior Mar 13, 2020
04027b9
Temporarily removed a test with huge running time on Azure (#1591)
ivan100sic Mar 16, 2020
02857d1
Some refactoring of FancyZones::IsInterestingWindow and added Unit Te…
yevhenii44-zz Mar 16, 2020
97e98d2
Remove failing Svg Preview Handler Unit Tests in CI (#1583)
udit3333 Mar 16, 2020
96a7e4f
disable unit tests in CI (#1592)
enricogior Mar 16, 2020
2cc6d2e
Fixed some compiler warnings (#1577)
ivan100sic Mar 16, 2020
1fc6798
Bump acorn from 5.7.3 to 5.7.4 in /src/settings-web (#1588)
dependabot[bot] Mar 16, 2020
437303e
added IPC wrapper
Mar 16, 2020
d7b77b1
removed ARM X86 and Any CPU configs
Mar 16, 2020
f49727e
Invalid json test cases + strings validation (#1558)
SeraphimaZykova Mar 16, 2020
d8c1cb2
fix for #1595 (#1598)
crutkas Mar 16, 2020
0ccc8ff
fixed formating and removed warning as erros
Mar 17, 2020
7146416
treat warning as errors
Mar 17, 2020
72eb761
Fixed issue with autostarting as admin even if it should as user, fix…
PrzemyslawTusinski Mar 17, 2020
419fc15
WinAppDriver tests (#1371)
SeraphimaZykova Mar 17, 2020
fd5518a
added comments
Mar 17, 2020
535ee72
removed debug outputs
Mar 17, 2020
98ed178
Double-qoute the paths when passing them as cmd args (#1604)
stefansjfw Mar 17, 2020
0633133
updated comments
Mar 17, 2020
3de6664
Merge branch 'master' of https://github.com/microsoft/PowerToys into …
Mar 17, 2020
28727ee
Revert "removed debug outputs"
Mar 17, 2020
6ea54da
Merge branch 'user/lamotile/add_ipc_csharp' of https://github.com/mic…
Mar 17, 2020
0430e41
Merge branch 'dev/settingsV2' into user/lamotile/add_ipc_csharp
Mar 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 19 additions & 199 deletions PowerToys.sln

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions src/common/two_way_pipe_message_ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <Sddl.h>
#include <accctrl.h>
#include <aclapi.h>
#include <list>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why include it?


class TwoWayPipeMessageIPC
{
Expand Down Expand Up @@ -53,6 +54,7 @@ class TwoWayPipeMessageIPC
std::thread output_queue_thread;
std::thread input_pipe_thread;
std::mutex pipe_connect_handle_mutex; // For manipulating the current_connect_pipe
std::wstring outgoing_message;

HANDLE current_connect_pipe_handle = NULL;
bool closed = false;
Expand Down Expand Up @@ -124,12 +126,12 @@ class TwoWayPipeMessageIPC
NULL); // not overlapped
if (!fSuccess)
{

return;
}
CloseHandle(output_pipe_handle);
return;
}

void consume_output_queue_thread()
{
while (!closed)
Expand All @@ -142,7 +144,7 @@ class TwoWayPipeMessageIPC
send_pipe_message(message);
}
}

BOOL GetLogonSID(HANDLE hToken, PSID* ppsid)
{
// From https://docs.microsoft.com/en-us/previous-versions/aa446670(v=vs.85)
Expand Down Expand Up @@ -465,12 +467,17 @@ class TwoWayPipeMessageIPC
{
while (!closed)
{
outgoing_message = L"";
std::wstring message = input_queue.pop_message();
if (message.length() == 0)
{
break;
}
dispatch_inc_message_function(message);
if (dispatch_inc_message_function != nullptr)
{
dispatch_inc_message_function(message);
}
outgoing_message = message;
}
}
};
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>
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>
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;
}

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
Loading