示例#1
0
文件: u3util.c 项目: flaub/HotFuzz
void host_clean_up(void)
{
  DWORD disposition;
  char **pext;
  char *u3_device_serial;
  char reg_key[BUFSIZ];

  /* the device has been removed -
     just close the application as quickly as possible */

  app_stop(0);

  /* DELETE THE FILE ASSOCIATIONS */
  for(pext = extensions; *pext; pext++)
    disassociate(*pext);

  /* update icons */
  SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);

  /* DELETE THE U3 Wireshark TYPE */
  strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1);
  strncat(reg_key, SHELL_OPEN_COMMAND, strlen(SHELL_OPEN_COMMAND) + 1);

  RegDeleteKey(HKEY_CLASSES_ROOT, reg_key);

  /* delete the open key */
  strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1);
  strncat(reg_key, SHELL_OPEN, strlen(SHELL_OPEN) + 1);

  RegDeleteKey(HKEY_CLASSES_ROOT, reg_key);

  /* delete the shell key */
  strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1);
  strncat(reg_key, SHELL, strlen(SHELL) + 1);

  RegDeleteKey(HKEY_CLASSES_ROOT, reg_key);

  /* delete the icon key */
  strncpy(reg_key, WIRESHARK_ASSOC, strlen(WIRESHARK_ASSOC) + 1);
  strncat(reg_key, DEFAULT_ICON, strlen(DEFAULT_ICON) + 1);

  RegDeleteKey(HKEY_CLASSES_ROOT, reg_key);

  /* finally delete the toplevel key */
  RegDeleteKey(HKEY_CLASSES_ROOT, WIRESHARK_ASSOC);

  uninstall(WINPCAP_KEY, WINPCAP_U3INSTALLED, WINPCAP_UNINSTALL);
  uninstall(VCREDIST_KEY, VCREDIST_U3INSTALLED, VCREDIST_UNINSTALL);

}
示例#2
0
static void cleanup(void)
{
      uninstall();
#ifdef TEST
      puts("Keyboard trap uninstalled");
#endif
}
示例#3
0
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: displayError((*reinterpret_cast< QAbstractSocket::SocketError(*)>(_a[1]))); break;
        case 1: connectedChannel(); break;
        case 2: disconnectedChannel(); break;
        case 3: readTxChannel(); break;
        case 4: readRxChannel(); break;
        case 5: refreshCount(); break;
        case 6: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        case 7: setIcon((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 8: save(); break;
        case 9: start(); break;
        case 10: stop(); break;
        case 11: install(); break;
        case 12: uninstall(); break;
        default: ;
        }
        _id -= 13;
    }
    return _id;
}
ExtensionListItem::ExtensionListItem(bool editor, bool showUpdateInfo, QWidget* pParent) : QWidget(pParent)
{
   //KIP - Fix up the layout of this widget.
   QVBoxLayout* pTopLevel = new QVBoxLayout(this);

   QHBoxLayout* pInfo = new QHBoxLayout;
   pTopLevel->addLayout(pInfo);
   mpIcon = new QLabel("pix", this);
   pInfo->addWidget(mpIcon);
   pInfo->addSpacing(10);

   QVBoxLayout* pText = new QVBoxLayout;
   pInfo->addLayout(pText);
   pInfo->addStretch();

   QHBoxLayout* pFirst = new QHBoxLayout;
   pText->addLayout(pFirst);
   mpName = new QLabel(this);
   mpName->setWordWrap(true);
   QFont boldFont = mpName->font();
   boldFont.setBold(true);
   mpName->setFont(boldFont);
   pFirst->addWidget(mpName);
   mpVersion = new QLabel(this);
   pFirst->addWidget(mpVersion);

   mpDescription = new QLabel(this);
   mpDescription->setWordWrap(true);
   pText->addWidget(mpDescription);

   if (showUpdateInfo)
   {
      mpUpdateInfo = new QLabel(this);
      mpUpdateInfo->setFont(boldFont);
      pText->addWidget(mpUpdateInfo);
   }
   else
   {
      mpUpdateInfo = NULL;
   }

   if (editor)
   {
      mpButtons = new QDialogButtonBox(this);
      mpButtons->addButton("Disable", QDialogButtonBox::ActionRole)->setEnabled(false);
      mpUninstallButton = mpButtons->addButton("Uninstall", QDialogButtonBox::DestructiveRole);
      connect(mpUninstallButton, SIGNAL(clicked()), this, SLOT(uninstall()));
      mpButtons->addButton("About", QDialogButtonBox::HelpRole);
      mpButtons->addButton("Update", QDialogButtonBox::ApplyRole)->setEnabled(false);
      pTopLevel->addWidget(mpButtons);
      connect(mpButtons, SIGNAL(helpRequested()), this, SLOT(about()));
   }
   else
   {
      mpButtons = NULL;
      mpUninstallButton = NULL;
   }
   pTopLevel->addStretch();
}
示例#5
0
/* Abort a running installation (to be called from the update function) */
void abort_install(void)
{
    if ( UI.abort )
        UI.abort(info);
	if ( info && ! info->install_complete )
		uninstall(info);
    exit_setup(1);
}
void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchronous synchronous)
{
    uninstall();

    double startTime = monotonicallyIncreasingTime();
    m_lowMemoryHandler(critical, synchronous);
    unsigned holdOffTime = (monotonicallyIncreasingTime() - startTime) * s_holdOffMultiplier;
    holdOff(std::max(holdOffTime, s_minimumHoldOffTime));
}
示例#7
0
LRESULT InstallOptionsDialog::OnRemove(WORD, WORD code, HWND, BOOL&) {
  const bool non_silent = false;
	uninstall(non_silent);
	installed = false;
	cn_.EnableWindow(!installed);
	tw_.EnableWindow(!installed);
	remove_.EnableWindow(installed);
	return 0;
}
示例#8
0
void signal_abort(int sig)
{
    signal(SIGINT, SIG_IGN);
    if ( UI.abort )
        UI.abort(info);
	if ( info && ! info->install_complete )
		uninstall(info);
    exit_setup(2);
}
示例#9
0
void MainWindow::stop()
{
    if (serverStatus == true) {
        serverStatus = false;
        switchButton->setText("Start");
        uninstall();
    	setIcon(serverStatus);
    }
}
示例#10
0
/*
 * Get a single event, process it, and return.
 *
 */
domulti(){
    int event;
  
    event = evnt_multi(MU_MESAG,
			1,1,butdown,
			0,0,0,0,0,
			0,0,0,0,0,
			msgbuff,0,0,&mx,&my,&ret,&ret,&keycode,&ret);
  
    if (event & MU_MESAG)
        switch (msgbuff[0]) {
	    case WM_REDRAW:
		do_redraw(msgbuff[4],msgbuff[5],msgbuff[6],msgbuff[7]);
		break;
	
	    case WM_NEWTOP:
	    case WM_TOPPED:
		wind_set(wi_handle, WF_TOP, 0, 0, 0, 0);
		break;
	
	    case WM_CLOSED:
		running = FALSE;
		break;
	
	    case MN_SELECTED:
		graf_mouse(HOURGLASS, 0L);
		switch(msgbuff[3]) {
		    case MNDESK:
			if(msgbuff[4] == DEABOUT) {
			    strcpy((about[ABVERSN].ob_spec)->te_ptext, "6.00");
			    about[ABOK].ob_state = NORMAL;
			    execform(about);
			    }
			break;		/* "cannot happen" */

		    case MNFILE:
			switch (msgbuff[4]) {
			    case FIQUIT:	/* [QUIT] item */
				running = 0;
				break;

			    case FIINST:	/* [INSTALL] item */
				install();
				break;
		
			    case FIUNINST:	/* [UNINSTALL] item */
				uninstall();
				break;
			}
			break;
		}
		menu_tnormal(menubar, msgbuff[3], 1); /* back to normal */
        	graf_mouse(ARROW, 0L);	/* restore mouse */
		break;
	}
}
示例#11
0
eResult service::recover()
{
   if (utils::fileexists(getPath()))
      uninstall();

   install();

   logmsg(kLINFO, getName() + " recovered.");
   return kRSuccess;
}
示例#12
0
SettingsJavaPluginForm::SettingsJavaPluginForm(QWidget* me, QObject* parent)
	: QObject(parent), m_reply(0), m_dlgProgress(me)
{
	setupUi(me);
	m_network = new QNetworkAccessManager(this);

	connect(pushUninstall, SIGNAL(clicked()), this, SLOT(uninstall()));
	connect(pushInstall, SIGNAL(clicked()), this, SLOT(install()));
	connect(&m_dlgProgress, SIGNAL(rejected()), this, SLOT(cancelDownload()));

	setupExtensionPages();
}
示例#13
0
文件: P_MAIN.C 项目: cepa/pong
int main(int argc,char **argv)
{
  install();

  game_menu1();

  uninstall();

  printf("PONG Clone\nCopyright (c) By CEPA 2004\[email protected]\nwww.cepa.end.pl\n");

  return 0;
}
示例#14
0
void ScriptNode::update(const std::unordered_set<Datum*>& active)
{
    // Remove any datums that weren't marked as active and trigger
    // changes to anything that was watching them.
    std::list<Datum*> inactive;
    for (const auto& d : datums)
        if (active.find(d.get()) == active.end())
            inactive.push_back(d.get());
    for (auto d : inactive)
        uninstall(d);

    triggerWatchers();
}
void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchronous synchronous)
{
    uninstall();

    double startTime = monotonicallyIncreasingTime();
    int64_t processMemory = processMemoryUsage();
    releaseMemory(critical, synchronous);
    int64_t bytesFreed = processMemory - processMemoryUsage();
    unsigned holdOffTime = s_maximumHoldOffTime;
    if (bytesFreed > 0 && static_cast<size_t>(bytesFreed) >= s_minimumBytesFreedToUseMinimumHoldOffTime)
        holdOffTime = (monotonicallyIncreasingTime() - startTime) * s_holdOffMultiplier;
    holdOff(std::max(holdOffTime, s_minimumHoldOffTime));
}
示例#16
0
void NewstuffModel::cancel( int index )
{
    if ( !d->isTransitioning( index ) ) {
        return;
    }

    { // <-- do not remove, mutex locker scope
        QMutexLocker locker( &d->m_mutex );
        if ( d->m_currentAction.first == index ) {
            if ( d->m_currentAction.second == NewstuffModelPrivate::Install ) {
                if ( d->m_currentReply ) {
                    d->m_currentReply->abort();
                    d->m_currentReply->deleteLater();
                    d->m_currentReply = nullptr;
                }

                if ( d->m_unpackProcess ) {
                    d->m_unpackProcess->terminate();
                    d->m_unpackProcess->deleteLater();
                    d->m_unpackProcess = nullptr;
                }

                if ( d->m_currentFile ) {
                    d->m_currentFile->deleteLater();
                    d->m_currentFile = nullptr;
                }

                d->m_items[d->m_currentAction.first].m_downloadedSize = 0;

                emit installationFailed( d->m_currentAction.first, tr( "Installation aborted by user." ) );
                d->m_currentAction = NewstuffModelPrivate::Action( -1, NewstuffModelPrivate::Install );
            } else {
                // Shall we interrupt this?
            }
        } else {
            if ( d->m_currentAction.second == NewstuffModelPrivate::Install ) {
                NewstuffModelPrivate::Action install( index, NewstuffModelPrivate::Install );
                d->m_actionQueue.removeAll( install );
                emit installationFailed( index, tr( "Installation aborted by user." ) );
            } else {
                NewstuffModelPrivate::Action uninstall( index, NewstuffModelPrivate::Uninstall );
                d->m_actionQueue.removeAll( uninstall );
                emit uninstallationFinished( index ); // do we need failed here?
            }
        }
    }

    d->processQueue();
}
示例#17
0
    IMPEXP OSStatus
    MAIN( OSType message, PluginMessageInfo* messageInfo, void* /*refCon*/ )
    {
        switch ( message )
        {
            case kPluginInitMessage:
                initLogger();

              #if TARGET_OS_MAC
                if ( !isClientInstalled() )
                {
                    uninstall();
                    return noErr;
                }
              #endif
                
                launchClient(); //launches client, on mac
                setupIPodSystem(); //sets up iPod scrobbling

              #if TARGET_OS_WIN32
                LOG( 3, "Initialising ScrobSubmitter" );
                gSubmitter.Init( "itw", ScrobSubCallback, 0 );
              #endif
                
                return RegisterVisualPlugin( messageInfo );

        
            case kPluginPrepareToQuitMessage:
                LOG( 3, "EVENT: kPluginPrepareToQuitMessage" );

                cleanup();
                return noErr;

        
            case kPluginCleanupMessage:
                LOG( 3, "EVENT: kPluginCleanupMessage" );

              #if TARGET_OS_WIN32
                LOG( 3, "Terminating ScrobSubmitter" );
                gSubmitter.Term();
              #endif

                return noErr;

        
            default:
                return unimpErr;
        }
    }
示例#18
0
static int Run(LPTSTR lpCmdLine)
{
	const bool silent = true;
	bool uninstalling = !wcscmp(L"/u", lpCmdLine);
	if (uninstalling)
		return uninstall(silent);
	bool hans = !wcscmp(L"/s", lpCmdLine);
	if (hans)
		return install(false, silent);
	bool hant = !wcscmp(L"/t", lpCmdLine);
	if (hant)
		return install(true, silent);

	return CustomInstall();
}
示例#19
0
int ThemesDlg::addThemeToList(const QString &file)
{
    kDebug() << "addThemeToList() file: " << file ;
    int i = themeIndex(file);
    if (i < 0) {
        ThemeWidget* item = new ThemeWidget(new ThemeFile(file));

        i = tableThemes->insertItem((QWidget*)item);
        item->buttonGo->setText(i18n("Uninstall"));
        QObject::connect((QObject*)item->buttonGo, SIGNAL(clicked()),
                         (QObject*)this, SLOT(uninstall()));
    }
    tableThemes->setSelected(i);
    return i;
}
示例#20
0
int
main (int argc, char **argv)
{
  int result;

  /* get request data */
  pi = pkgmgr_installer_new ();
  if (!pi)
    return ENOMEM;
  result = pkgmgr_installer_receive_request (pi, argc, argv);
  if (result)
    {
      pkgmgr_installer_free (pi);
      return -result;
    }

  /* treat the request */
  switch (pkgmgr_installer_get_request_type (pi))
    {
    case PKGMGR_REQ_INSTALL:
      result = install ();
      break;

    case PKGMGR_REQ_UNINSTALL:
      result = uninstall ();
      break;

    case PKGMGR_REQ_REINSTALL:
      result = reinstall ();
      break;

    case PKGMGR_REQ_MOVE:
      result = move ();
      break;

    case PKGMGR_REQ_CLEAR:
    case PKGMGR_REQ_RECOVER:
    case PKGMGR_REQ_GETSIZE:
    case PKGMGR_REQ_UPGRADE:
    case PKGMGR_REQ_SMACK:
    default:
      /* unsupported operation */
      result = EINVAL;
      break;
    }
  pkgmgr_installer_free (pi);
  return result;
}
示例#21
0
unsigned int __stdcall download(void *param)
/* downloads a file from the internet */
{
	unsigned long r;
	unsigned long w;
	char buffer[4096];
	struct dls dl = *(struct dls *)param;
	struct dls *pdl = (struct dls *)param;
	HINTERNET ih = InternetOpen("Mozilla/4.0 (compatible)", INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0);
	HINTERNET fh = InternetOpenUrl(ih, dl.url, 0, 0, 0, 0);
	pdl->gotinfo = true;
	if(fh)
	{
		HANDLE f = CreateFile(dl.dest, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
		if(f == INVALID_HANDLE_VALUE)
		{
			clearthread(dl.tnum);
			_endthreadex(0);
		}
		do
		{
			InternetReadFile(fh, buffer, sizeof(buffer), &r);
			WriteFile(f, buffer, r, &w, 0);
		}
		while(r > 0);
		CloseHandle(f);
		InternetCloseHandle(fh);
		InternetCloseHandle(ih);
		if(dl.update) /* update to new bot */
		{
			if(dl.updatex)
				ShellExecute(0, "open", dl.dest, 0, 0, SW_HIDE);
			else
			{
				char buf[256];
				_snprintf(buf, sizeof(buf), "%s,start", dl.dest);
				ShellExecute(0, "open", "rundll32.exe", buf, 0, SW_HIDE);
			}
			irc_send("QUIT");
			uninstall();
		}
		else if(dl.run) /* open file */
			ShellExecute(0, "open", dl.dest, 0, 0, SW_SHOW);
	}
	clearthread(dl.tnum);
	_endthreadex(0);
	return 0;
}
示例#22
0
void AVFilterSubtitle::setPlayer(AVPlayer *player)
{
    if (m_player == player)
        return;
    uninstall();
    if (m_player) {
        disconnect(this);
    }
    m_player = player;
    if (!player)
        return;
    player->installFilter(this);
    if (m_auto) {
//        connect(player, SIGNAL(fileChanged(QString)), SLOT(findAndSetFile(QString)));
        connect(player, SIGNAL(started()), SLOT(onPlayerStart()));
    }
}
示例#23
0
VOID objprogress(HWND hwnd, HWND hprgs) {
   PINSTALLDATA pid = WinQueryWindowPtr(hwnd, 0);
   if (!pid) return;
   switch (pid->flprgrs) {
      case ID_IPRDRVINFO: // riempie lista drive
         fillDrvList(pid, hprgs);
         break;
      case ID_IPRINSTLING: // esegue installazione
         install(pid, hprgs);
         break;
      case ID_IPRRFRSHING: // ricrea gli oggetti
         refresh(pid, hprgs);
         break;
      case ID_IPRDELETING: // disinstalla
         uninstall(pid, hprgs);
         break;
   } /* endswitch */
}
示例#24
0
BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL,
						  DWORD fdwReason,
						  LPVOID lpReserved)
{
	switch (fdwReason)
	{

	case DLL_PROCESS_ATTACH:
		g_hInstance = hinstDLL;
		break;

	case DLL_PROCESS_DETACH:
		uninstall();
		break;

	}
	return 1;
}
示例#25
0
int main(int argc, char *argv[])
{
   if (argc > 1)
   {
      char dll[2*CCHMAXPATH] = {0};
      char buffer[2*CCHMAXPATH];
      char currentdir[2*CCHMAXPATH];
      HMODULE hmodule;
      ULONG length;
      BOOL ok = 0;

      if(argc > 2)
      {
         strcpy(dll,argv[2]);
         if (*strchr(dll,'\0') - 1 != '\\')
         {
            *strchr(dll,'\0') = '\\';
            *(strchr(dll,'\0') + 1) = '\0';
         }
      }

      strcat(dll,"wpsexts");

      printf("Warning: the class will register successfully\n"
              "even if the WPS doesn't find the DLL.\n\n");

      if (argv[1][0] == 'i')
      {
         ok += install(dll,"WPSAgentSam","WPObject");
         if(ok) printf("Please reboot or restart the Workplace Shell.\n");
      }
      else if (argv[1][0] == 'u')
      {
         ok += uninstall("WPSAgentSam","WPObject");
         if(ok) printf("Please reboot or restart the Workplace Shell.\n");
      }
      else printf("use i for install and u for uninstall followed by an optional path");
   }
   else printf("use i for install and u for uninstall followed by an optional path");

   return 1;
}
示例#26
0
//---------------------------------------------------------------------------
Service & Service::uninstall(SC_HANDLE hSCManager)
{
  uninstall();
  utf8::WideString serviceNameW(serviceName_.getUNICODEString());
  SC_HANDLE handle = OpenServiceW(
    hSCManager,
    serviceNameW,
    SERVICE_ALL_ACCESS
  );
  if( handle == NULL ){
    int32_t err = GetLastError() + errorOffset;
    newObjectV1C2<Exception>(err,__PRETTY_FUNCTION__)->throwSP();
  }
  if( DeleteService(handle) == 0 ){
    int32_t err = GetLastError() + errorOffset;
    CloseServiceHandle(handle);
    newObjectV1C2<Exception>(err,__PRETTY_FUNCTION__)->throwSP();
  }
  CloseServiceHandle(handle);
  return *this;
}
示例#27
0
static int copy_iterator(void *info,HASH_CELL *m, word index_in_tbl, word index_in_chain)
{
      if( ((COPY_ITERATOR_PARAMETERS *)info)->from_to_priors<0)/*from overrides*/
         install(
          ((COPY_ITERATOR_PARAMETERS *)info)->copy_tag(m->tag),
          ((COPY_ITERATOR_PARAMETERS *)info)->copy_cell(m->cell),
          ((COPY_ITERATOR_PARAMETERS *)info)->to_table
         );
      else if( ((COPY_ITERATOR_PARAMETERS *)info)->from_to_priors>0){/*to overrides*/
         if(
         *look_up(
         m->tag,
         ((COPY_ITERATOR_PARAMETERS *)info)->to_table) == NULL)/*absent!*/
         install(
          ((COPY_ITERATOR_PARAMETERS *)info)->copy_tag(m->tag),
          ((COPY_ITERATOR_PARAMETERS *)info)->copy_cell(m->cell),
          ((COPY_ITERATOR_PARAMETERS *)info)->to_table
         );
      }else /* == 0, just delete "from" from "to": */
          uninstall(m->tag,((COPY_ITERATOR_PARAMETERS *)info)->to_table);
      return 0;
}/*copy_iterator*/
示例#28
0
void MainWindow::save()
{
    QString s;

    s.sprintf("%d.%d.%d.%d",
            ipAddr0->value(),
            ipAddr1->value(),
            ipAddr2->value(),
            ipAddr3->value());

    if (s != config->getHostAddress()) {
    	config->setHostAddress(s);

    	config->save();

	    // statusBar->showMessage("Save proxy server config ...", 1000 * 3);

	    // {
		// QMessageBox messagebox;
		// messagebox.setText("Server IP is changed\nYou need to reinstall driver");
		// messagebox.exec();
	    // }
    }

    if (serverStatus) {
        serverStatus = false;
        switchButton->setText("Start");
        uninstall();
    } else {
        serverStatus = true;
        switchButton->setText("Stop");
        install();
    }

    setIcon(serverStatus);
}
static int do_remove(char **arg, char reply[REPLY_MAX])
{
    return uninstall(arg[0], atoi(arg[1])); /* pkgname, userid */
}
示例#30
0
QAnimationDriver::~QAnimationDriver()
{
    QUnifiedTimer *timer = QUnifiedTimer::instance(false);
    if (timer && timer->canUninstallAnimationDriver(this))
        uninstall();
}