Skip to content

Commit

Permalink
Cleaned some unneeded stuff in the setup binary, and restored exporte…
Browse files Browse the repository at this point in the history
…d functions for launching/restarting Explorer
  • Loading branch information
Amrsatrio committed Sep 12, 2024
1 parent ac14c75 commit 9811810
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
10 changes: 7 additions & 3 deletions ExplorerPatcher/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1140,6 +1143,7 @@ HRESULT InputBox(BOOL bPassword, HWND hWnd, LPCWSTR wszPrompt, LPCWSTR wszTitle,

return hr;
}
#endif

UINT PleaseWaitTimeout = 0;
HHOOK PleaseWaitHook = NULL;
Expand Down
8 changes: 5 additions & 3 deletions ExplorerPatcher/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 5 additions & 0 deletions ep_setup/ep_setup.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 9811810

Please # to comment.