Harbour Error GPF., permiso para ejecutar binario

Harbour Error GPF., permiso para ejecutar binario

Postby jnavas » Mon Nov 05, 2018 11:25 pm

Saludos
Cuando instalo mi sistema en OS Windows 8, al arrancar generar error GPF y sale del sistema
Debo otorgarle permiso , accedo a explorador, Mi PC, Propiedades, configuracion avanzada del sistema, rendimiento, prevencion de ejecucion de datos "DEP", boton Agregar, debo indicar la ruta y nombre del programa.

Necesito una manera directa de asignar este permiso y evitarle al usuario realizar demasiados pasos.
User avatar
jnavas
 
Posts: 479
Joined: Wed Nov 16, 2005 12:03 pm
Location: Caracas - Venezuela

Re: Harbour Error GPF., permiso para ejecutar binario

Postby jnavas » Tue Nov 06, 2018 11:14 am

Saludos a todos
Encontré esta funcionalidad, voy a probarla
http://freyes.svetlian.com/RunAs/RunAs.htm
runas /user:pippin /savecred miaplicacion.exe
User avatar
jnavas
 
Posts: 479
Joined: Wed Nov 16, 2005 12:03 pm
Location: Caracas - Venezuela

Re: Harbour Error GPF., permiso para ejecutar binario

Postby Antonio Linares » Tue Nov 06, 2018 11:55 am

http://www.source-code.biz/snippets/c/1.htm

la función del API de Windows que proporciona esta funcionalidad es: CreateProcessWithLogonW()
https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createprocesswithlogonw

Code: Select all  Expand view  RUN
// miniRunAs  -  A minimalist "run as" for Windows (a runas.exe alternative)
//
// Home page: www.source-code.biz/snippets/c/1.htm
// License: GNU/LGPL (www.gnu.org/licenses/lgpl.html)
// Copyright 2008 Christian d'Heureuse, Inventec Informatik AG, Switzerland.
// This software is provided "as is" without warranty of any kind.
//
// Version history:
// 2008-03-09 Christian d'Heureuse (chdh@inventec.ch)
//   Module created.
// 2011-07-05 Christian d'Heureuse (chdh@inventec.ch)
//   lpDomain parameter of CreateProcessWithLogonW changed from L"." to NULL.


#define UNICODE
#define _WIN32_WINNT 0x0500                                // Win2K and later
#include <stdio.h>
#include <Windows.h>

static const char*           programVersion = "2008-03-09";

static wchar_t               user[64];
static wchar_t               password[64];
static wchar_t               commandLine[1024];

static void displayHelp() {
   printf ("\n");
   printf ("miniRunAs  -  A minimalist \"run as\"\n");
   printf ("\n");
   printf ("Usage:   miniRunAs <user> <password> <commandline>\n");
   printf ("Example: miniRunAs administrator sesame ping localhost\n");
   printf ("Author:  Christian d'Heureuse, www.source-code.biz, chdh@inventec.ch\n");
   printf ("License: GNU/LGPL (www.gnu.org/licenses/lgpl.html)\n");
   printf ("Version: %s\n", programVersion); }

static void displayWin32ApiError (const char* routineName) {
   DWORD errorCode = GetLastError();
   wchar_t* msg = NULL;
   int i = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
         NULL, errorCode, 0, (LPWSTR)&msg, 0, NULL);
   if (i == 0) {
      fprintf (stderr, "FormatMessage failed for error code %i.\n", errorCode); return; }
   fwprintf (stderr, L"Error code %i returned from %S.\n%s\n", errorCode, routineName, msg);
   LocalFree (msg); }

static const wchar_t* skipBlanks (const wchar_t* s) {
   while (*s == L' ') s++;
   return s; }

static const wchar_t* skipNonBlanks (const wchar_t* s) {
   while (*s != 0 && *s != L' ') s++;
   return s; }

static const wchar_t* skipPastChar (const wchar_t* s, wchar_t c) {
   while (*s != 0) {
      if (*s == c) {s++; break; }
      s++; }
   return s; }

static const wchar_t* parseNextWord (const wchar_t* s, wchar_t* wBuf, int wBufSize) {
   const wchar_t* s1 = skipBlanks(s);
   const wchar_t* s2 = skipNonBlanks(s1);
   wcsncpy_s (wBuf, wBufSize, s1, s2-s1);
   return s2; }

static bool parseCommandLineParms() {
   const wchar_t* s = GetCommandLine();
   s = skipBlanks(s);
   if (*s == L'"')
      s = skipPastChar(s+1, L'"');                         // if the commandline starts with a quote, we have to skip past the next quote
    else
      s = skipNonBlanks(s);                                // otherwise the program path does not contain blanks and we skip to the next blank
   s = skipBlanks(s);
   if (*s == 0) {                                          // no command-line parameters
      displayHelp();
      return false; }
   s = parseNextWord(s, user, sizeof(user)/2);
   s = parseNextWord(s, password, sizeof(password)/2);
   s = skipBlanks(s);
   wcscpy_s (commandLine, s);
   if (commandLine[0] == 0) {
      fprintf (stderr, "Missing command-line arguments.\n");
      return false; }
   return true; }

int main() {
   if (!parseCommandLineParms()) return 9;
   STARTUPINFOW si;
   memset (&si, 0, sizeof(si));
   si.cb = sizeof(si);
   PROCESS_INFORMATION pi;
   BOOL ok = CreateProcessWithLogonW (
      user,
      NULL,                                                // change to L"." to use local account database only
      password,
      LOGON_WITH_PROFILE,
      NULL,
      commandLine,
      0,
      NULL,
      NULL,
      &si,
      &pi);
   if (ok == 0) {
      displayWin32ApiError ("CreateProcessWithLogonW");
      return 9; }
   return 0; }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour Error GPF., permiso para ejecutar binario

Postby jnavas » Wed Nov 07, 2018 8:45 am

Antonio
Saludos y Gracias,
Utilicé el comando
runas /user:administrator /savecred dpnmwin.exe
y aun persiste la incidencia, buscaré en el registro de windows lugar donde se almacena los binarios permisados.
User avatar
jnavas
 
Posts: 479
Joined: Wed Nov 16, 2005 12:03 pm
Location: Caracas - Venezuela

Re: Harbour Error GPF., permiso para ejecutar binario

Postby karinha » Wed Nov 07, 2018 2:10 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Harbour Error GPF., permiso para ejecutar binario

Postby jnavas » Fri Nov 09, 2018 6:56 am

Saludos y Gracias
El comando RUNAS.EXE no resuelve el permiso del binario.
Aun sigue generando el error GPF
User avatar
jnavas
 
Posts: 479
Joined: Wed Nov 16, 2005 12:03 pm
Location: Caracas - Venezuela

Re: Harbour Error GPF., permiso para ejecutar binario

Postby Baxajaun » Fri Nov 09, 2018 7:26 am

User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests