TIntegrationEvent::TIntegrationEvent( char *name, char *short_name, INT_TIME time, long code, int priority, TIntegrationEventCategory category) /* -------------------------- * Author : Bruno Orsier : Original Delphi code Diego Segura / Gilles Orazi : C++ translation * Created : 06/2002 * Purpose : * History : * -------------------------- */ { assert(strlen(name) < INT_MAX_STRING_LENGTH); assert(strlen(short_name) < INT_MAX_SHORT_STRING_LENGTH); Name(name); Time(time); Code(code); m_priority = priority; ShortName(short_name); Category(category); #ifdef INTEGR_DEBUG ++Glob_InEventsCount; ++Glob_InEventsTotal; #endif }
void CFolderDialog::OnInitDialog() { // Default handing of the init dialog message sets the selection to // the initial folder SetSelection(m_strInitialFolderName); SetStatusText(ShortName(m_strInitialFolderName)); }
const Automaton* Manifest::FindAutomaton(const Identifier& ID) const { auto i = Automata.find(ID); if (i == Automata.end()) panic("TESLA manifest does not contain assertion " + ShortName(ID)); return i->second; }
// prepare text in the format accepted by DrawFields class using given photo and selected columns // String Columns::GetStatusText(const std::vector<uint16>& selected_columns, const PhotoInfo& photo, bool includeNames) const { oStringstream ost; const TCHAR* SEP= _T("\t"); const size_t fields= selected_columns.size(); for (size_t i= 0; i < fields; ++i) { int index= selected_columns[i]; if (includeNames) ost << DrawFields::LABEL << ShortName(index) << _T(": "); String value; GetInfo(value, index, photo); ost << DrawFields::VALUE << value << SEP; } String str= ost.str(); // lame trim right while (str.size() > 0 && str[str.size() - 1] == *SEP) str.resize(str.size() - 1); return str; }
void ModuleGetInfo(native_t address, ModuleInfo * info) { if (NULL != info) { #ifdef OS_WINDOWS MODULEINFO mi = {0}; HMODULE hPSAPI = LoadLibraryA("psapi.dll"); if (NULL != hPSAPI) { pGetModuleInformation = (pfnGetModuleInformation) GetProcAddress(hPSAPI, "GetModuleInformation"); if (NULL != pGetModuleInformation) { if (pGetModuleInformation(GetCurrentProcess(), (HMODULE) address, &mi, sizeof(MODULEINFO))) { info->address = (native_t) mi.lpBaseOfDll; info->size = (uint32_t) mi.SizeOfImage; if (GetModuleFileNameA((HMODULE) address, info->path, NtfsMaxPath)) { xstrcat(info->name, NtfsMaxPath, ShortName(info->path) + 1); } } } FreeLibrary(hPSAPI); } #endif /* OS_WINDOWS */ } }
TIntegrationEvent::TIntegrationEvent( const TIntegrationEvent &source ) /* -------------------------- * Author : Bruno Orsier : Original Delphi code Diego Segura / Gilles Orazi : C++ translation * Created : 06/2002 * Purpose : * History : * -------------------------- */ { Name(source.Name()); Time(source.Time()); Code(source.Code()); m_priority = source.Priority(); ShortName(source.ShortName()); Category(source.Category()); #ifdef INTEGR_DEBUG ++Glob_InEventsCount; ++Glob_InEventsTotal; #endif }
TIntegrationEvent& TIntegrationEvent::operator=(const TIntegrationEvent& source) /* -------------------------- * Author : Bruno Orsier : Original Delphi code Diego Segura / Gilles Orazi : C++ translation * Created : 06/2002 * Purpose : * History : * -------------------------- */ { if( this != &source ) { Name(source.Name()); Time(source.Time()); Code(source.Code()); m_priority = source.Priority(); ShortName(source.ShortName()); Category(source.Category()); } return *this; }
const TCHAR* Columns::Abbreviation(int index) const { switch (index) { case COL_PHOTO_NAME: case COL_DATE_TIME: // these two are obvious without a label return _T(""); case COL_FNUMBER: return _T("A"); // aperture case COL_EXP_TIME: return _T("S"); // shatter speed case COL_FOCAL_LENGTH: return _T("FL"); case COL_FOCAL_LENGTH_35MM: return _T("FL(35)"); case COL_ISO: return _T("ISO"); default: return ShortName(index); } }
void CFolderDialog::OnSelChanged(ITEMIDLIST* pIdl) { ::SHGetPathFromIDList(pIdl, m_szPath); m_strFinalFolderName = m_szPath; SetStatusText(ShortName(m_strFinalFolderName)); }
////////////////////////////////////////////////////////////////////////// // // // // ////////////////////////////////////////////////////////////////////////// BOOL CCFile::IsNamed(char* szName) { return (strcmp(ShortName(), szName) == 0); }
void StackWalkInit() { HANDLE hProcess = GetCurrentProcess(); hDbgHelp = LoadLibraryA("dbghelp.dll"); if (NULL != hDbgHelp) { char path[NtfsMaxPath] = {0}; char temp[NtfsMaxPath]; pSymInitialize = (pfnSymInitialize) GetProcAddress(hDbgHelp, "SymInitialize"); pSymCleanup = (pfnSymCleanup) GetProcAddress(hDbgHelp, "SymCleanup"); pSymGetOptions = (pfnSymGetOptions) GetProcAddress(hDbgHelp, "SymGetOptions"); pSymSetOptions = (pfnSymSetOptions) GetProcAddress(hDbgHelp, "SymSetOptions"); pStackWalk64 = (pfnStackWalk64) GetProcAddress(hDbgHelp, "StackWalk64"); pSymGetSymFromAddr64 = (pfnSymGetSymFromAddr64) GetProcAddress(hDbgHelp, "SymGetSymFromAddr64"); pSymFunctionTableAccess64 = (pfnSymFunctionTableAccess64) GetProcAddress(hDbgHelp, "SymFunctionTableAccess64"); pSymGetModuleBase64 = (pfnSymGetModuleBase64) GetProcAddress(hDbgHelp, "SymGetModuleBase64"); pSymGetModuleInfo64 = (pfnSymGetModuleInfo64) GetProcAddress(hDbgHelp, "SymGetModuleInfo64"); pSymLoadModule64 = (pfnSymLoadModule64) GetProcAddress(hDbgHelp, "SymLoadModule64"); if (GetCurrentDirectoryA(NtfsMaxPath, temp)) { temp[NtfsMaxPath - 1] = 0; xstrcat(path, NtfsMaxPath, temp); xstrcat(path, NtfsMaxPath, ";"); } if (GetModuleFileNameA(NULL, temp, NtfsMaxPath)) { temp[NtfsMaxPath - 1] = 0; ShortName(temp)[0] = 0; xstrcat(path, NtfsMaxPath, temp); xstrcat(path, NtfsMaxPath, ";"); } if (GetEnvironmentVariableA("_NT_SYMBOL_PATH", temp, NtfsMaxPath)) { temp[NtfsMaxPath - 1] = 0; xstrcat(path, NtfsMaxPath, temp); xstrcat(path, NtfsMaxPath, ";"); } if (GetEnvironmentVariableA("_NT_ALTERNATE_SYMBOL_PATH", temp, NtfsMaxPath)) { temp[NtfsMaxPath - 1] = 0; xstrcat(path, NtfsMaxPath, temp); xstrcat(path, NtfsMaxPath, ";"); } if (GetEnvironmentVariableA("SYSTEMROOT", temp, NtfsMaxPath)) { temp[NtfsMaxPath - 1] = 0; xstrcat(path, NtfsMaxPath, temp); xstrcat(path, NtfsMaxPath, ";"); xstrcat(temp, NtfsMaxPath, "\\system32"); xstrcat(path, NtfsMaxPath, temp); xstrcat(path, NtfsMaxPath, ";"); } if (GetEnvironmentVariableA("TEMP", temp, NtfsMaxPath)) { temp[NtfsMaxPath - 1] = 0; xstrcat(path, NtfsMaxPath, "SRV*"); xstrcat(path, NtfsMaxPath, temp); xstrcat(path, NtfsMaxPath, "\\websymbols*http://msdl.microsoft.com/download/symbols;"); } else { xstrcat(path, NtfsMaxPath, "SRC*C:\\temp\\websymbols*http://msdl.microsoft.com/download/symbols;"); } if (pSymInitialize(hProcess, path, false)) { DWORD options = pSymGetOptions(); options |= SYMOPT_DEBUG; pSymSetOptions(options); LoadModules(hProcess); } } }
bool CFileName::SameFile(const CFileName &o) const { return 0==ShortName().CompareNoCase(o.ShortName()); }