library AppCtrl; {$IMAGEBASE $5a000000} {$ifdef win64} // {$LIBSUFFIX '64'} {$else} {$LIBSUFFIX '32'} {$endif} uses Windows, System.SysUtils, System.Classes, Generics.Collections, Generics.Defaults, System.IOUtils, BsoneMtpHook in 'BsoneMtpHook.pas', BsoneDebug in 'BsoneDebug.pas', BsoneUtil in 'BsoneUtil.pas', DefineHelper in 'C:\taskToCSG\eCrmHE\EXE_eCrmHeHelper\DefineHelper.pas', FileHandleListUnit in 'FileHandleListUnit.pas', GlobalDefine in '..\dist\GlobalDefine.pas', Bs1ContentsFlowPolicyUnit in 'Bs1ContentsFlowPolicyUnit.pas', ObexParserUnit in 'ObexParserUnit.pas', ApiHookExplorer in 'ApiHookExplorer.pas'; {$R *.res} var processName : string; BsoneMtpHook_: TBsoneMtpHook = nil; procedure DLLEntryPoint(dwResaon : DWORD); var buffer: array[0..MAX_PATH - 1] of WideChar; sLogPath : string; begin case dwResaon of DLL_PROCESS_ATTACH: begin try GetModuleFileName(0, buffer, MAX_PATH); processName:= TPath.GetFileName(buffer); OutputDebugString(PChar(Format('[BSONE] DLL_PROCESS_ATTACH (%s)', [processName]))); BsoneMtpHook_ := TBsoneMtpHook.Create(HInstance); except on E: Exception do begin OutputDebugString(PChar(Format('[BSONE] DLL_PROCESS_ATTACH except : (%s)', [E.Message]))); end; end; end; DLL_PROCESS_DETACH: begin OutputDebugStringW(PChar(Format('[BSONE] DLL_PROCESS_DETACH : (%s)', [processName]))); if Assigned(BsoneMtpHook_) then FreeAndNil(BsoneMtpHook_); end; end; end; begin DllProc := @DLLEntryPoint; DLLEntryPoint(DLL_PROCESS_ATTACH); end.