예제 #1
0
extern "C" __declspec(dllexport) void entryPoint()
{
#ifdef _DEBUG
	OutputDebugString("entryPoint called");
#endif

	HANDLE hEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, EVENTNAME);
	if (!hEvent)
		displayError(L"Could not open interprocess communication event.");

	WCHAR pwszError[ERROR_BUFFER_SIZE];

	if (!validateVersion())
		displayError(L"You must at least have Microsoft Windows XP to use this library.");

	if (!CRawInput::initialize(pwszError))
		displayError(pwszError);

	if (!CRawInput::hookLibrary(true))
		displayError(L"Failed to hook Windows API cursor functions.");

	// Signal the injector that the injection and hooking are successful
	if (!SetEvent(hEvent))
		displayError(L"Failed to signal the initialization event.");

	CloseHandle(hEvent);

	if (!CRawInput::pollInput())
		displayError(L"Failed to poll mouse input");

#ifdef _DEBUG
	OutputDebugString("Finished entryPoint");
#endif
}
예제 #2
0
SCBWriter::SCBWriter(const std::string& pathName, const std::string& version,
                     SimulatorInterface* sim)
    : _frameWriter(0x0) {
  if (!validateVersion(version)) {
    logger << Logger::ERR_MSG << "Invalid SCB version: " << version << "\n";
    throw SCBVersionException();
  }
  logger << Logger::INFO_MSG << "SCBWRITER: version: " << _version[0] << ".";
  logger << _version[1] << "\n";
  _file.open(pathName.c_str(), std::ios::out | std::ios::binary);
  if (!_file.is_open()) {
    throw SCBFileException();
  }
  _sim = sim;
  writeHeader();
}
예제 #3
0
Lng32 TrafDesc::migrateToNewVersion(
     NAVersionedObject *&newImage)
{
  short tempimagesize = getClassSize();
  // -----------------------------------------------------------------
  // The base class implementation of migrateToNewVersion() is only
  // called with newImage == NULL when the same function is not
  // redefined at the subclass. That means no new version of that
  // subclass has been invented yet.
  // -----------------------------------------------------------------
  if (newImage == NULL)
    {
      if (validateSize())
        return -1;

      if (validateVersion())
        return -1;
    }

  return NAVersionedObject::migrateToNewVersion(newImage);
}