AnonSec Team
Server IP : 127.0.0.1  /  Your IP : 127.0.0.1
Web Server : Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3
System : Windows NT WIN-R7LTCC7BPLI 6.3 build 9200 (Windows Server 2012 R2 Datacenter Edition) i586
User : GerbangSIPAD ( 0)
PHP Version : 5.6.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF
Directory (0777) :  C:/xampp5/src/xampp-start-stop/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : C:/xampp5/src/xampp-start-stop/xampp_util.c
// Copyright (C) 2007-2010 Kai Seidler, oswald@apachefriends.org, GPL-licensed

#include <windows.h>
#include <stdio.h>
#include <process.h>
#include <string.h>

#include "xampp_util.h"

void xampp_call(char *start[10][10])
{
	int s;
	int i;
	char buffer[200];

	i=0;
	s=0;
	while(1)
	{
		if(start[i][0]==NULL)
			break;
		sprintf(buffer,"%s",start[i][0]);
		s=_spawnvp(P_NOWAIT,buffer, start[i]);
		if(s==-1)
		{
			printf("Error while calling %s...\n",buffer);
		}
		i++;
	}
	
	return;
}

void xampp_stop(char *pidfile,char *eventformat)
{
       	HANDLE shutdownEvent;
        char shutdownEventName[32];
	FILE *fp;
	long pid;

        fp=fopen(pidfile,"r");
        if(!fp)
        {
                printf("Can't find %s.\n", pidfile);
        }
        else
        {
                fscanf(fp,"%d", &pid);
                fclose(fp);

                sprintf_s(shutdownEventName, sizeof(shutdownEventName), eventformat, pid);
                shutdownEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, shutdownEventName);
                if (shutdownEvent != NULL)
                {
                        SetEvent(shutdownEvent);
                }
                else
                {
                        printf("Can't find process #%d.\n", pid);
                }
        }

}

void xampp_cdx()
{
	char path[1000];
	char *ptr;

	//path[ sizeof(path) -1] = 0;

	GetModuleFileName( NULL, path, sizeof( path ) -1 );
	ptr=strrchr(path,'\\');
	*ptr='\0';

	chdir(path);
	//printf("chdir(%s)\n", path);
}

AnonSec - 2021