Skip to content

Commit

Permalink
Delete parental control check.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Nov 11, 2015
1 parent 706fce4 commit ab829e1
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions src/xrEngine/x_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,6 @@ void foo()

ENGINE_API bool g_dedicated_server = false;

#ifndef DEDICATED_SERVER
// forward declaration for Parental Control checks
BOOL IsPCAccessAllowed();
#endif // DEDICATED_SERVER

int APIENTRY WinMain_impl(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
char* lpCmdLine,
Expand Down Expand Up @@ -735,14 +730,6 @@ int APIENTRY WinMain_impl(HINSTANCE hInstance,
// Check for virtual memory
if ((strstr(lpCmdLine, "--skipmemcheck") == NULL) && IsOutOfVirtualMemory())
return 0;

// Parental Control for Vista and upper
if (!IsPCAccessAllowed())
{
MessageBox(NULL, "Access restricted", "Parental Control", MB_OK | MB_ICONERROR);
return 1;
}

// Check for another instance
#ifdef NO_MULTI_INSTANCES
#define STALKER_PRESENCE_MUTEX "Local\\STALKER-COP"
Expand Down Expand Up @@ -1440,57 +1427,6 @@ void CApplication::LoadAllArchives()
}
}

#ifndef DEDICATED_SERVER
// Parential control for Vista and upper
typedef BOOL(*PCCPROC)(CHAR*);

BOOL IsPCAccessAllowed()
{
CHAR szPCtrlChk[MAX_PATH], szGDF[MAX_PATH], *pszLastSlash;
HINSTANCE hPCtrlChk = NULL;
PCCPROC pctrlchk = NULL;
BOOL bAllowed = TRUE;

if (!GetModuleFileName(NULL, szPCtrlChk, MAX_PATH))
return TRUE;

if ((pszLastSlash = strrchr(szPCtrlChk, '\\')) == NULL)
return TRUE;

*pszLastSlash = '\0';

strcpy_s(szGDF, szPCtrlChk);

strcat_s(szPCtrlChk, "\\pctrlchk.dll");
if (GetFileAttributes(szPCtrlChk) == INVALID_FILE_ATTRIBUTES)
return TRUE;

if ((pszLastSlash = strrchr(szGDF, '\\')) == NULL)
return TRUE;

*pszLastSlash = '\0';

strcat_s(szGDF, "\\Stalker-COP.exe");
if (GetFileAttributes(szGDF) == INVALID_FILE_ATTRIBUTES)
return TRUE;

if ((hPCtrlChk = LoadLibrary(szPCtrlChk)) == NULL)
return TRUE;

if ((pctrlchk = (PCCPROC)GetProcAddress(hPCtrlChk, "pctrlchk")) == NULL)
{
FreeLibrary(hPCtrlChk);
return TRUE;
}

bAllowed = pctrlchk(szGDF);

FreeLibrary(hPCtrlChk);

return bAllowed;
}
#endif // DEDICATED_SERVER

//launcher stuff----------------------------
extern "C" {
typedef int __cdecl LauncherFunc(int);
Expand Down

0 comments on commit ab829e1

Please sign in to comment.