foobar2000 SDK  2015-01-14
componentversion.cpp
Go to the documentation of this file.
1 #include "foobar2000.h"
2 
4  const char * path = core_api::get_my_full_path();
5  path += pfc::scan_filename(path);
6  bool retVal = ( strcmp(path, fn) == 0 );
7  PFC_ASSERT( retVal );
8  return retVal;
9 }
11  for(int retry = 0;;) {
13  path.truncate(path.scan_filename());
14  path << fn;
15  try {
16  try {
17  abort_callback_dummy aborter;
18  bool v = filesystem::g_exists(path, aborter);
19  PFC_ASSERT( v );
20  return v;
21  } catch(std::exception const & e) {
22  FB2K_console_formatter() << "Component integrity check error: " << e << " (on: " << fn << ")";
23  throw;
24  }
25  } catch(exception_io_denied) {
26  continue;
27  } catch(exception_io_sharing_violation) {
28  continue;
29  } catch(exception_io_file_corrupted) { // happens
30  return false;
31  } catch(...) {
32  uBugCheck();
33  }
34  if (++retry == 10) uBugCheck();
35  Sleep(100);
36  }
37 }
static bool test_my_name(const char *fn)
abort_callback_impl abort_callback_dummy
const char * get_my_full_path()
Retrieves full path of calling dll, e.g. file://c:.dll.
string8_fastalloc string_formatter
Definition: string_base.h:614
t_size scan_filename(const char *ptr)
std::exception exception
Definition: primitives.h:193
PFC_NORETURN void SHARED_EXPORT uBugCheck()
static bool have_other_file(const char *fn)