13 #pragma managed( push, off ) 43 , m_psMappingInfo(
nullptr )
78 DWORD dwProcessId = ::GetCurrentProcessId();
79 for (
int nIndex = 0;; ++nIndex ) {
95 wchar_t szBuffer[ MAX_PATH ];
97 if ( !m_cEventRequest.Create( szBuffer ) ) {
111 for (
int nIndex = 0;
DEVICE_MAX > nIndex; ++nIndex ) {
120 wchar_t szPath[ MAX_PATH ];
162 m_cThreadSub.Close();
168 m_cEventNotify.Close();
171 m_cEventRequest.Close();
208 wchar_t const* pszMessage = L
"ダイセンジガケ ダラナヨサ";
209 for ( ;; ++pszMessage ) {
216 else if ( L
'\0' == *pszMessage ) {
218 for (
int nIndex = 0; 100 > nIndex; ++nIndex ) {
232 else if ( L
' ' == *pszMessage ) {
234 for (
int nIndex = 0; 50 > nIndex; ++nIndex ) {
247 for (
int nIndex = 0; 25 > nIndex; ++nIndex ) {
277 if (
nullptr == pszString ) {
286 for ( ;; ++pszString ) {
288 if ( L
'\0' == *pszString ) {
294 else if ( BUFFER_SIZE <= m_psMappingInfo->m_nCount ) {
302 else if ( BUFFER_SIZE <= m_psMappingInfo->m_nCount ) {
382 DWORD dwProcessId = ::GetCurrentProcessId();
383 for (
int nIndex = 0;; ++nIndex ) {
421 DWORD dwProcessId = ::GetCurrentProcessId();
422 for (
int nIndex = 0;; ++nIndex ) {
489 DWORD dwProcessId = ::GetCurrentProcessId();
492 if ( nCount <= nIndex ) {
504 for ( ; nCount > nIndex; ++nIndex ) {
519 for (
int nDevice = 0;
DEVICE_MAX > nDevice; ++nDevice ) {
526 bool bResult =
false;
531 wchar_t szBuffer[ MAX_PATH ];
534 if ( cRequest.
Open( szBuffer ) ) {
536 if ( cRequest.
Set() ) {
573 for (
int nIndex = 0;; ++nIndex ) {
606 DWORD dwProcessId = ::GetCurrentProcessId();
607 for (
int nIndex = 0;; ++nIndex ) {
632 if ( !cProcess.
Wait( 0 ) ) {
656 wchar_t const* pszMessage = L
"";
659 pszMessage = L
", All Processes Termination";
663 ExOutputLineFormat(
true,
false, L
"Indent#%ld, By Terminated Process[%04X], Count = %ld%s." 670 for (
int nDevice = 0;
DEVICE_MAX > nDevice; ++nDevice ) {
674 for (
int nDevice2 = 0;; ++nDevice2 ) {
763 #if defined( _WINDLL ) && !defined( _MANAGED ) 771 return ::GetModuleHandleW(
nullptr );
786 if (
nullptr == rpcInstance ) {
818 wchar_t szDrive[ _MAX_DRIVE ];
819 wchar_t szDir [ _MAX_DIR ];
820 wchar_t szFName[ _MAX_FNAME ];
821 wchar_t szExt [ _MAX_EXT ];
822 if ( 0 != ::_wsplitpath_s( pszPath, szDrive, szDir, szFName, szExt ) ) {
827 else if ( 0 >= ::swprintf_s( pszPath, nSize, L
"%s%s%s#??.log", szDrive, szDir, szFName ) ) {
834 WIN32_FIND_DATAW sFindData;
835 HANDLE hFind = ::FindFirstFileW( pszPath, &sFindData );
836 if ( INVALID_HANDLE_VALUE != hFind ) {
838 long long unsigned llMax = 0;
841 if ( 0 < ::swprintf_s( pszPath, nSize, L
"%s%s%s", szDrive, szDir, sFindData.cFileName ) ) {
843 HANDLE handle = ::CreateFileW( pszPath, GENERIC_READ, FILE_SHARE_READ,
nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_ARCHIVE,
nullptr );
844 if ( INVALID_HANDLE_VALUE != handle ) {
847 if ( 0 != ::GetFileTime( handle,
nullptr,
nullptr, &time ) ) {
849 long long unsigned tmp = (
static_cast< long long unsigned >( time.dwHighDateTime ) << 32 ) |
static_cast< long long unsigned >( time.dwLowDateTime );
850 if ( llMax <= tmp ) {
855 wNumber =
static_cast< WORD
>( ( ::wcstol( &sFindData.cFileName[ ::wcslen( szFName ) + 1 ],
nullptr, 10 ) + 1 ) % 100 );
860 ::CloseHandle( handle );
865 if ( 0 == ::FindNextFileW( hFind, &sFindData ) ) {
872 ::FindClose( hFind );
876 ::swprintf_s( pszPath, nSize, L
"%s%s%s#%02u.log", szDrive, szDir, szFName, wNumber );
897 #pragma managed( pop ) virtual bool Open(wchar_t const *pszObjectName) noexcept
オープン関数
#define NotifyConstructor()
コンストラクタ実行通知マクロ
static wchar_t const * GetProjectType() noexcept
プロジェクト種別取得関数
virtual bool SetDeviceProcess(EOutputDevice eDevice, DWORD dwProcessId) noexcept
出力デバイスプロセス設定関数
virtual bool Flush() noexcept
フラッシュ関数
#define NotifyFatalError()
致命的エラー発生通知マクロ
virtual void Close() noexcept override
クローズ関数
static wchar_t const *const EVENT_NOTIFY_NAME
通知イベント名
int m_nRequestPos
出力要求開始位置
static DWORD WINAPI SubThreadProc(LPVOID lpParam) noexcept
サブスレッド関数
CEvent m_cEventRequest
要求イベント
static CLibLogOut s_cInstance
静的インスタンス
#define NotifyDestructor()
デストラクタ実行通知マクロ
static HINSTANCE GetInstanceHandle() noexcept
インスタンスハンドル取得関数
virtual LPVOID GetView() const noexcept
ビューポインタ取得関数
virtual bool OutputString(wchar_t const *pszString) noexcept override
文字列出力関数
virtual bool UpdateProcessInfo(bool bCurrent=false) noexcept
プロセス情報更新関数
CLibLogOut() noexcept
コンストラクタ
SMappingInfo * m_psMappingInfo
共有メモリ情報構造体ポインタ
wchar_t m_szPath[MAX_PATH]
ログ出力ファイルパス
virtual bool Indent() noexcept override
インデント関数
static bool GetNewLogFilePath(wchar_t *pszPath, int nSize) noexcept
新規ログ出力ファイルパス取得関数
virtual bool IsCreate() const noexcept
新規作成状態取得関数
#define _PROJECT_TYPE
プロジェクト種別定義
#define ConsoleNewLine()
改行出力マクロ
virtual bool Wait(DWORD dwTime=INFINITE) noexcept
ウェイト関数
#define ConsoleChar(...)
1文字出力マクロ
virtual bool Unindent() noexcept override
アンインデント関数
EOutputDevice m_eDevice
出力要求デバイス種別
virtual bool Open(DWORD dwProcessId, DWORD dwAccess=SYNCHRONIZE) noexcept
オープン関数
DWORD m_dwProcessId[DEVICE_MAX]
出力プロセスID配列
static wchar_t const *const OBJECT_NAME
オブジェクト名
static wchar_t const *const EVENT_REQUEST_FORMAT
要求イベント名書式設定文字列
virtual int GetCount() noexcept
バッファカウント取得関数
virtual ~CLibLogOut() noexcept
デストラクタ
virtual bool Set() noexcept
シグナルセット関数
SProcessInfo m_sProcess[PROCESS_MAX]
参照プロセス情報構造体配列
#define ConsoleString(...)
文字列出力マクロ
int m_nRequestSize
出力要求サイズ
virtual int GetRefferCount() noexcept
参照プロセスカウント取得関数
static DWORD const NOTIFY_WAIT
通知イベント待機時間
virtual int GetIndentCount() noexcept override
インデントカウント取得関数
virtual bool UpdateLineNumber() noexcept override
行番号更新関数
virtual bool OutputDevice() noexcept
デバイス出力関数
wchar_t m_szBuffer[BUFFER_SIZE+1]
文字列バッファ
#define ConsoleWindowHandle()
ウィンドウハンドル取得マクロ
virtual bool Create(DWORD dwSize, wchar_t const *pszObjectName=nullptr) noexcept
作成関数
LIB_COMMON_API wchar_t const * GetExeFileName(wchar_t *pszBuffer, size_t uSize) noexcept
実行ファイル名取得関数
#define ConsoleKbHitDirect()
直接入力検査マクロ
bool m_bEnable[DEVICE_MAX]
出力許可フラグ配列
LIB_COMMON_API wchar_t const * GetExeFilePath(wchar_t *pszBuffer, size_t uSize) noexcept
実行ファイルパス取得関数
#define ConsoleClearInput()
入力バッファクリアマクロ
static int const DEVICE_MAX
出力デバイス最大値
virtual int GetLineNumber() noexcept override
行番号取得関数
virtual bool ExOutputLineFormat(bool bHeader, bool bIndent, wchar_t const *pszFormat,...) noexcept
拡張書式設定文字列行出力関数
CFileStream m_cFileLog
ログ出力ファイル
CEvent m_cEventNotify
通知イベント
virtual void Close() noexcept override
クローズ関数
virtual bool OutputString(wchar_t const *pszString) noexcept override
文字列出力関数
DWORD m_dwProcessId
プロセスID
static int const PROCESS_MAX
最大参照プロセス数
#define DebugString(...)
文字列出力マクロ