mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Self-contained .NET (#22217)
* dotnet sc
* MD preview - C# app
- working self-contained
* Gcode preview - C# app
* DevFiles preview - C# app
* Fix passing path with spaces as cmd arg and monacocpp proj file
* Pdf preview - C# app
* Svg preview - C# app
* Fix comment
* Gcode thumbnail - C# app
TODO:
- installer
- why IThumbnailProvider and IIntializeWithFile doesn't work?
* Pdf thumbnail - C# app
TODO:
- installer
- why IThumbnailProvider and IIntializeWithFile doesn't work?
* Pdf thumbnail - C# app
TODO:
- installer
- why IThumbnailProvider and IIntializeWithFile doesn't work?
* Fix GcodeThumbnailProviderCpp.vcxproj
* Svg thumbnail - C# app
TODO:
- installer
- why IThumbnailProvider and IIntializeWithFile doesn't work?
* Fix Svg tests
* Thumbnail providers - installer
* Self-contained Hosts and FileLocksmith
* Fix hardcoded <RuntimeIdentifier>
* Remove unneeded files
* Try to fix Nuget in PR CI
* Prefix new dlls with PowerToys.
Sign new dlls and exes
* Add new .exe files to ProcessList
* ci: debug by listing all env vars
* ci: try setting variable in the right ci file
* Bring back hardcoded RuntimeIdentifier
* ci: Add comment and remove debug action
* Remove unneeded lib
* [WIP] Platform conditional dotnet files & hardlinks
* Cleanup
* Update expect.txt
* Test fix - ARM installer
* Fix uninstall bug
* Update docs
* Fix failing test
* Add dll details
* Minor cleanup
* Improve resizing
* Add some logs
* Test fix - release build
* Remove InvokeOnControlThread
* Test fix: logger initialization
* Fix arm64 installer
Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
This commit is contained in:
73
src/modules/previewpane/SvgPreviewHandlerCpp/dllmain.cpp
Normal file
73
src/modules/previewpane/SvgPreviewHandlerCpp/dllmain.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
// dllmain.cpp : Defines the entry point for the DLL application.
|
||||
#include "pch.h"
|
||||
#include "ClassFactory.h"
|
||||
|
||||
HINSTANCE g_hInst = NULL;
|
||||
long g_cDllRef = 0;
|
||||
|
||||
// {FCDD4EED-41AA-492F-8A84-31A1546226E0}
|
||||
static const GUID CLSID_SvgPreviewHandler = { 0xfcdd4eed, 0x41aa, 0x492f, { 0x8a, 0x84, 0x31, 0xa1, 0x54, 0x62, 0x26, 0xe0 } };
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
g_hInst = hModule;
|
||||
DisableThreadLibraryCalls(hModule);
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// FUNCTION: DllGetClassObject
|
||||
//
|
||||
// PURPOSE: Create the class factory and query to the specific interface.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// * rclsid - The CLSID that will associate the correct data and code.
|
||||
// * riid - A reference to the identifier of the interface that the caller
|
||||
// is to use to communicate with the class object.
|
||||
// * ppv - The address of a pointer variable that receives the interface
|
||||
// pointer requested in riid. Upon successful return, *ppv contains the
|
||||
// requested interface pointer. If an error occurs, the interface pointer
|
||||
// is NULL.
|
||||
//
|
||||
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv)
|
||||
{
|
||||
HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;
|
||||
|
||||
if (IsEqualCLSID(CLSID_SvgPreviewHandler, rclsid))
|
||||
{
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
||||
ClassFactory* pClassFactory = new ClassFactory();
|
||||
if (pClassFactory)
|
||||
{
|
||||
hr = pClassFactory->QueryInterface(riid, ppv);
|
||||
pClassFactory->Release();
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
//
|
||||
// FUNCTION: DllCanUnloadNow
|
||||
//
|
||||
// PURPOSE: Check if we can unload the component from the memory.
|
||||
//
|
||||
// NOTE: The component can be unloaded from the memory when its reference
|
||||
// count is zero (i.e. nobody is still using the component).
|
||||
//
|
||||
STDAPI DllCanUnloadNow(void)
|
||||
{
|
||||
return g_cDllRef > 0 ? S_FALSE : S_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user