Browse Source

Cleaned some unneeded stuff in the setup binary, and restored exported functions for launching/restarting Explorer

pull/3714/head
Amrsatrio 1 year ago
parent
commit
98118101e6
  1. 10
      ExplorerPatcher/utility.c
  2. 8
      ExplorerPatcher/utility.h
  3. 5
      ep_setup/ep_setup.vcxproj

10
ExplorerPatcher/utility.c

@ -138,7 +138,8 @@ __declspec(dllexport) int CALLBACK ZZTestToast(HWND hWnd, HINSTANCE hInstance, L @@ -138,7 +138,8 @@ __declspec(dllexport) int CALLBACK ZZTestToast(HWND hWnd, HINSTANCE hInstance, L
}
#endif
/*__declspec(dllexport)*/ int CALLBACK ZZLaunchExplorer(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow)
#ifndef EP_BUILD_SETUP
__declspec(dllexport) int CALLBACK ZZLaunchExplorer(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow)
{
Sleep(100);
TCHAR wszExplorerPath[MAX_PATH + 1];
@ -170,19 +171,20 @@ __declspec(dllexport) int CALLBACK ZZTestToast(HWND hWnd, HINSTANCE hInstance, L @@ -170,19 +171,20 @@ __declspec(dllexport) int CALLBACK ZZTestToast(HWND hWnd, HINSTANCE hInstance, L
return 0;
}
/*__declspec(dllexport)*/ int CALLBACK ZZLaunchExplorerDelayed(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow)
__declspec(dllexport) int CALLBACK ZZLaunchExplorerDelayed(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow)
{
Sleep(2000);
ZZLaunchExplorer(hWnd, hInstance, lpszCmdLine, nCmdShow);
return 0;
}
/*__declspec(dllexport)*/ int CALLBACK ZZRestartExplorer(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow)
__declspec(dllexport) int CALLBACK ZZRestartExplorer(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow)
{
BeginExplorerRestart(NULL);
FinishExplorerRestart();
return 0;
}
#endif
void* ReadFromFile(wchar_t* wszFileName, DWORD* dwSize)
{
@ -719,6 +721,7 @@ LSTATUS RegisterDWMService(DWORD dwDesiredState, DWORD dwOverride) @@ -719,6 +721,7 @@ LSTATUS RegisterDWMService(DWORD dwDesiredState, DWORD dwOverride)
return TRUE;
}
#ifndef EP_BUILD_SETUP
char* StrReplaceAllA(const char* s, const char* oldW, const char* newW, int* dwNewSize)
{
char* result;
@ -1140,6 +1143,7 @@ HRESULT InputBox(BOOL bPassword, HWND hWnd, LPCWSTR wszPrompt, LPCWSTR wszTitle, @@ -1140,6 +1143,7 @@ HRESULT InputBox(BOOL bPassword, HWND hWnd, LPCWSTR wszPrompt, LPCWSTR wszTitle,
return hr;
}
#endif
UINT PleaseWaitTimeout = 0;
HHOOK PleaseWaitHook = NULL;

8
ExplorerPatcher/utility.h

@ -131,11 +131,13 @@ __declspec(dllexport) int CALLBACK ZZTestBalloon(HWND hWnd, HINSTANCE hInstance, @@ -131,11 +131,13 @@ __declspec(dllexport) int CALLBACK ZZTestBalloon(HWND hWnd, HINSTANCE hInstance,
__declspec(dllexport) int CALLBACK ZZTestToast(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
#endif
/*__declspec(dllexport)*/ int CALLBACK ZZLaunchExplorer(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
#ifndef EP_BUILD_SETUP
__declspec(dllexport) int CALLBACK ZZLaunchExplorer(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
/*__declspec(dllexport)*/ int CALLBACK ZZLaunchExplorerDelayed(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
__declspec(dllexport) int CALLBACK ZZLaunchExplorerDelayed(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
/*__declspec(dllexport)*/ int CALLBACK ZZRestartExplorer(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
__declspec(dllexport) int CALLBACK ZZRestartExplorer(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow);
#endif
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
#define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))

5
ep_setup/ep_setup.vcxproj

@ -225,6 +225,11 @@ @@ -225,6 +225,11 @@
<AdditionalLibraryDirectories>$(SolutionDir)libs\zlib\build-$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>EP_BUILD_SETUP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(WithEncryption)' == 'true'">
<ClCompile>
<PreprocessorDefinitions>WITH_ENCRYPTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>

Loading…
Cancel
Save