????? ????? ?????? ????? ??????? shelled ?? Visual FoxPro

?????? ????????? ?????? ?????????
???? ???????: 193846 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ?????? ??????? ????? ????? ??????? ????? ?? ?????? kernel Win32. ????? ???????? ????? ?????? ?????? ???? ?? ???????? ??????? ??? ????. ???? ??? ??????? ????? ????? ?????? ????? ??????? shelled.

??????? ????

???? Win32 ?????? ???????? ??????? ???????:
  • ????
  • ????
  • ????
  • ????? ???????
???? ?? ?????? ?????? ??????? ?????? ?????? ?? ????? ??????.

??? ???????? ??????? ?? ????????? ???? ??? ????? ?? ?? ???????? ??????? ???.

???? ??? ???????? ?????? ??? ????? ???? ?????? ?????? ?? ???? ????? ????? ??????? ?????? ??? ???? ???? ????. ?????? ?????? ????? ?????? ??? ??? ???????? ?????? ????? ???????? ??? ???????? ??????? ?? ???????. ???? ?? ????? ?????? Windows ??? ?? ?????? ????? ??? ???????? ?? ??? ???????? ??? ????? ?? ??????? ??? ???? ???????. ??????? ??????? ???? ??? ??????? ??? ??? ?????? ???? ???? ???? ??????? ??? ??? ???????? ??????? ???? CPU ??????? ???????? ??????? ????.

???? ?????? ????? ??????? ??? ????? ???? ??? ???????? ?????? ????????. ?????? ?????? ????? ?????? ??? ?????? ????? ??????? ?????? ??????? ???? ???????? ??????? ??? ?? ??? ?????? ???? ??????? ????? ?????? ??????. ??? ???? ??????? ????? ?? ????? ??????? ???? ????? ???? ?? ?????? ???? ??????? ???? ???? ????? ??????? ?????? ???? ??? ??? ?? ????? ?????? ?? ?? ??????. ??? ??????? ??? ???????? ??????? ?????.

??? ????? ???????? ??????? ?? ???? ????? ??? ???????? ??????? API CreateProcess.

???? ?????? ?????? ??? ????? ??????? ??????? Windows ??? Windows NT 4.0 ? ????? ????? Windows ?????? ???????? ?????? ?????. ?????? ?????? ????? ??????? 'dwCreationFlags' ???? ?? ?????? ??? CreateProcess(). ??? ??? DEFINEs ???? ???? ???????? ???????? ?? ???? ????? ????????.

??? ????? ??? ??????? Notepad.exe ??? ???????? ??? ????? ???? Windows ? ??? ????? ??????? "????????" ? ???? ??? ?????? ?????? ??? Notepad.exe ?? ??? "????? ????????" ?? ??????? ????????.

?? ????? ??? ???? ???? ???? ???? ??? Notepad.exe ??????? ?? ????? ??????? ??????? 'File2Run'.

????? ????????? ????????

   #DEFINE NORMAL_PRIORITY_CLASS 32
   #DEFINE IDLE_PRIORITY_CLASS 64
   #DEFINE HIGH_PRIORITY_CLASS 128
   #DEFINE REALTIME_PRIORITY_CLASS 1600

   DECLARE INTEGER CreateProcess IN kernel32.DLL ;
      INTEGER lpApplicationName, ;
      STRING lpCommandLine, ;
      INTEGER lpProcessAttributes, ;
      INTEGER lpThreadAttributes, ;
      INTEGER bInheritHandles, ;
      INTEGER dwCreationFlags, ;
      INTEGER lpEnvironment, ;
      INTEGER lpCurrentDirectory, ;
      STRING @lpStartupInfo, ;
      STRING @lpProcessInformation

   DECLARE INTEGER GetLastError IN kernel32.DLL

   * Startup info is 68 bytes, of which we need to
   * initially populate the 'cb' or Count of Bytes member
   * with the overall length of the structure.
   * The remainder should be 0-filled.
   START = long2str(68) + REPLICATE(CHR(0), 64)

   * PROCESS_INFORMATION structure is 4 longs,
   * or 4*4 bytes = 16 bytes, which we'll initially zero.
   process_info = REPLICATE(CHR(0), 16)

   * Start a copy of NOTEPAD (EXE name must be null-terminated)
   File2Run = "C:\WINNT\NOTEPAD.EXE" + CHR(0)

   * Call CreateProcess, obtain a process handle. Treat the
   * application to run as the 'command line' argument, accept
   * all other defaults. Important to pass the start and
   * process_info by reference.
   RetCode = CreateProcess(0, File2Run, 0, 0, 1, ;
      IDLE_PRIORITY_CLASS, 0, 0, @START, @process_info)

   * Unable to run, exit now.
   IF RetCode = 0
      =MESSAGEBOX("Error occurred. Error code: ", GetLastError())
      RETURN
   ENDIF

   ********************
   FUNCTION long2str
   ********************
   * passed : 32-bit non-negative numeric value (m.longval)
   * returns : ascii character representation of passed
   *    value in low-high format (m.retstr)
   * example :
   *   m.long = 999999
   *   m.longstr = long2str(m.long)
   PARAMETERS m.longval

   PRIVATE i, m.retstr

   m.retstr = ""
   FOR i = 24 TO 0 STEP -8
      m.retstr = CHR(INT(m.longval/(2^i))) + m.retstr
      m.longval = MOD(m.longval, (2^i))
   NEXT
   RETURN m.retstr
						

?????

"???????? Windows" ? ????? Richter ????? Microsoft Press 92-103, 1997 Edition ??????? ? ISBN: 1-57231-548-2

???????

???? ???????: 193846 - ????? ??? ??????: 16/?? ?????/1425 - ??????: 3.4
????? ???
  • Microsoft Visual FoxPro 3.0b Standard Edition
  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 5.0a
  • Microsoft Visual FoxPro 6.0 Professional Edition
  • Microsoft Visual FoxPro 7.0 Professional Edition
  • Microsoft Visual FoxPro 8.0 Professional Edition
  • Microsoft Visual FoxPro 9.0 Professional Edition
????? ??????: 
kbmt kbhowto KB193846 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????193846

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com