forked from jewalky/srvmgr
-
Notifications
You must be signed in to change notification settings - Fork 5
/
charcheck.cpp
27 lines (25 loc) · 864 Bytes
/
charcheck.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include "charcheck.h"
#include "shared.h"
#include <shellapi.h>
#pragma warning(disable:4996) // no_deprecate
int __stdcall check_by_exe(char *login_name, int id_1, int id_2)
{
unsigned long exit=0;
SHELLEXECUTEINFO inf={0};
char cmd[] = "D:\\Games\\Allods\\PlScript\\a2c2.pl D:\\Games\\Allods\\Chr\\%c\\%s.lgn %u %u";
char cmd2[BUF_MAX];
_snprintf (cmd2, BUF_MAX-1, cmd, login_name[0], login_name, id_1, id_2);
inf.cbSize=sizeof (inf);
inf.hwnd = NULL;
inf.nShow = SW_HIDE;
inf.lpFile = "C:\\Perl\\bin\\perl.exe";
inf.lpParameters = cmd2;
inf.lpDirectory = "C:\\Games\\Allods\\PlScript";
inf.fMask=SEE_MASK_NOCLOSEPROCESS;
inf.lpVerb = "open";
ShellExecuteEx (&inf);
WaitForSingleObject(inf.hProcess, INFINITE);
GetExitCodeProcess(inf.hProcess,&exit );
return exit;
}