瀏覽代碼

* retrieve process ID even if running under DOS

git-svn-id: trunk@19644 -
Tomas Hajny 13 年之前
父節點
當前提交
21179c6833
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      rtl/emx/system.pas

+ 5 - 2
rtl/emx/system.pas

@@ -538,7 +538,11 @@ begin
 {$WARNING To be checked/corrected!}
                 ApplicationType := 1;   (* Running under DOS. *)
                 IsConsole := true;
-                ProcessID := 1;
+                asm
+                    mov ax, 7F05h
+                    call syscall
+                    mov ProcessID, eax
+                end ['eax'];
                 ThreadID := 1;
             end;
         osOS2:
@@ -560,7 +564,6 @@ begin
 {$WARNING To be checked/corrected!}
                 ApplicationType := 1;   (* Running under DOS. *)
                 IsConsole := true;
-                ProcessID := 1;
                 ThreadID := 1;
             end;
     end;