Beispiel #1
0
void xrPlayerSetSpeed(int cpu, int bus)
{
	unsigned int k = pspSdkSetK1(0);
	static bool inited = false;

	if (!inited) {
		scePowerSetClockFrequency2 =
			(void *) FindProc("scePower_Service", "scePower", 0x545A7F3C);
		scePowerIsBatteryCharging =
			(void *) FindProc("scePower_Service", "scePower", 0x1E490401);
		scePower_driver_A09FC577 =
			(void *) FindProc("scePower_Service", "scePower_driver",
							  0xA09FC577);
		scePower_driver_191A3848 =
			(void *) FindProc("scePower_Service", "scePower_driver",
							  0x191A3848);
		inited = true;
	}

	if (scePowerSetClockFrequency2 == 0 || scePowerIsBatteryCharging == 0
		|| scePower_driver_A09FC577 == 0 || scePower_driver_191A3848 == 0) {
		inited = false;
		return;
	}

	scePowerSetClockFrequency2(cpu, cpu, bus);
	if (scePowerIsBatteryCharging() != 0) {
		pspSdkSetK1(k);
		return;
	}
	static int ps1 = 0;

	if (ps1 == 0) {
		scePower_driver_A09FC577(1);
		ps1 = 1;
		pspSdkSetK1(k);
		return;
	}

	static int ps2 = 0;

	if (ps2 == 0) {
		ps1 = 0;
		ps2 = 1;
		pspSdkSetK1(k);
		return;
	}
	scePower_driver_191A3848(0);
	ps1 = 0;
	ps2 = 0;
	pspSdkSetK1(k);
}
Beispiel #2
0
int ScanTree::GetNext(FindData *FindData)
{
  if (Depth<0)
    return(SCAN_DONE);

  int FindCode;
  while (1)
  {
    if ((*CurMask==0 || FastFindFile && Depth==0) && !PrepareMasks())
      return(SCAN_DONE);
    FindCode=FindProc(FindData);
    if (FindCode==SCAN_ERROR)
    {
      Errors++;
      continue;
    }
    if (FindCode==SCAN_NEXT)
      continue;
    if (FindCode==SCAN_SUCCESS && FindData->IsDir && GetDirs==SCAN_SKIPDIRS)
      continue;
    if (FindCode==SCAN_DONE && PrepareMasks())
      continue;
    break;
  }
  return(FindCode);
}
int RefreshPluginMenu(int obj_id)
{
	doc_class* doc=FindItem(obj_id,Items);
	if(doc->ReallyCreateMenu==1)
	{
		HBITMAP hBitmapChecked = NULL;
		char* way=GetApplicationDir();
		CString pic;
		pic.Append(way);
		delete(way);
		pic.Append("\\pic\\application");
		SetCurrentDirectory(pic);
		if(FindProc(doc->app))
			pic="run.bmp";
		else 
			pic="stop.bmp";
		if(doc->pic!=NULL)DeleteObject(doc->pic);
		doc->pic = (HBITMAP)LoadImage(NULL,pic, IMAGE_BITMAP, 0, 0,
			LR_LOADFROMFILE  | LR_SHARED);
		pic.ReleaseBuffer();
		SetMenuItemBitmaps(doc->hMenu, obj_id*1000+1, MF_BYCOMMAND, doc->pic, doc->pic);
		EnableMenuItem(doc->hMenu,  obj_id*1000+1,(MF_BYCOMMAND+MF_GRAYED));
		EnableMenuItem(doc->hMenu,  obj_id*1000+1,(MF_BYCOMMAND+MF_ENABLED));
	}
	return 1;
}
Beispiel #4
0
SCAN_CODE ScanTree::GetNext(FindData *FindData)
{
  if (Depth<0)
    return(SCAN_DONE);


  SCAN_CODE FindCode;
  while (1)
  {
    if (*CurMask==0 && !GetNextMask())
      return(SCAN_DONE);


    FindCode=FindProc(FindData);
    if (FindCode==SCAN_ERROR)
    {
      Errors++;
      continue;
    }
    if (FindCode==SCAN_NEXT)
      continue;
    if (FindCode==SCAN_SUCCESS && FindData->IsDir && GetDirs==SCAN_SKIPDIRS)
      continue;
    if (FindCode==SCAN_DONE && GetNextMask())
      continue;
    break;
  }
  return(FindCode);
}
Beispiel #5
0
SCAN_CODE ScanTree::GetNext(FindData *FD)
{
  if (Depth<0)
    return SCAN_DONE;

#ifndef SILENT
  uint LoopCount=0;
#endif

  SCAN_CODE FindCode;
  while (1)
  {
    if (*CurMask==0 && !GetNextMask())
      return SCAN_DONE;

#ifndef SILENT
    // Let's return some ticks to system or WinRAR can become irresponsible
    // while scanning files in command like "winrar a -r arc c:\file.ext".
    // Also we reset system sleep timer here.
    if ((++LoopCount & 0x3ff)==0)
      Wait();
#endif

    FindCode=FindProc(FD);
    if (FindCode==SCAN_ERROR)
    {
      Errors++;
      continue;
    }
    if (FindCode==SCAN_NEXT)
      continue;
    if (FindCode==SCAN_SUCCESS && FD->IsDir && GetDirs==SCAN_SKIPDIRS)
      continue;
    if (FindCode==SCAN_DONE && GetNextMask())
      continue;
    if (FilterList.ItemsCount()>0 && FindCode==SCAN_SUCCESS)
      if (!CommandData::CheckArgs(&FilterList,FD->IsDir,FD->Name,false,MATCH_WILDSUBPATH))
        continue;
    break;
  }
  return FindCode;
}
Beispiel #6
0
void Entry(void)
{
	HHOOK hHook=NULL;
	HOOKPROC pfnHookProc;
	HWND hWnd=NULL;
	int result=1;

	g_controlMsg=RegisterWindowMessageA(CONTROL_MESSAGE_NAME);

	g_hDLL=LoadLibraryA(DLL_NAME);
	if(!g_hDLL)
	{
		DWORD err=GetLastError();
		char msg[500];

		FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,NULL,err,0,msg,sizeof msg,NULL);

		MessageBoxA(NULL,msg,DLL_NAME,MB_OK|MB_ICONERROR);
		goto done;
	}

	g_pfnSetKeyboardLayout=(SetKeyboardLayoutFn)FindProc("SetKeyboardLayout");
	if(!g_pfnSetKeyboardLayout)
		goto done;

	pfnHookProc=(HOOKPROC)FindProc(HOOKNAME("KBSwitchCBTHookProc"));
	if(!pfnHookProc)
		goto done;

	hHook=SetWindowsHookEx(WH_CBT,pfnHookProc,g_hDLL,0);
	if(!hHook)
		goto done;

	hWnd=CreateWnd();

	if(hWnd)
	{
		for(;;)
		{
			int r;
			MSG msg;

			r=GetMessage(&msg,NULL,0,0);
			if(r==0||r==-1)
				break;

			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}

		result=0;
	}

done:
	if(hWnd)
	{
		DestroyWindow(hWnd);
		hWnd=NULL;
	}

	if(hHook)
	{
		UnhookWindowsHookEx(hHook);
		hHook=NULL;
	}

	if(g_hDLL)
	{
		FreeLibrary(g_hDLL);
		g_hDLL=NULL;
	}

	ExitProcess(result);
}