From 6c9e22c9653ce7dcf587444d66850cd781d4f199 Mon Sep 17 00:00:00 2001 From: pc-ls Date: Mon, 29 May 2023 15:52:59 +0800 Subject: [PATCH] =?UTF-8?q?rundll32=E4=BE=8B=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- course/WinDriver/tools/tools/dllmain.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/course/WinDriver/tools/tools/dllmain.cpp b/course/WinDriver/tools/tools/dllmain.cpp index 6785c0e..0ea2992 100644 --- a/course/WinDriver/tools/tools/dllmain.cpp +++ b/course/WinDriver/tools/tools/dllmain.cpp @@ -1,6 +1,23 @@ // dllmain.cpp : 定义 DLL 应用程序的入口点。 #include "stdafx.h" +extern "C" +{ + // CALLBACK + __declspec(dllexport) void Foo(HWND hWindow, HINSTANCE hInstance, LPSTR lpszCommandLine, int nCmdShow) + { + if (strlen(lpszCommandLine) != 0) + { + ::MessageBoxA(hWindow, lpszCommandLine, "我是标题", MB_OK); + } + else + { + ::MessageBoxA(hWindow, "lpszCommandLine is NULL", "我是标题", MB_OK); + } + } +} + + BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved -- GitLab