diff --git a/programs/system/RunOD/1/LScript.x b/programs/system/RunOD/1/LScript.x index 2cc4ff9007..9bcdec43c9 100644 --- a/programs/system/RunOD/1/LScript.x +++ b/programs/system/RunOD/1/LScript.x @@ -2,6 +2,9 @@ PATH_SIZE = 1024; PARAMS_SIZE = 256; STACK_SIZE = 1024; +AppParams = $END + PATH_SIZE; +AppPath = $END; + SECTIONS { .all : AT(0){ @@ -12,8 +15,8 @@ SECTIONS LONG(END); LONG($END + PATH_SIZE + PARAMS_SIZE + STACK_SIZE); LONG($END + PATH_SIZE + PARAMS_SIZE + STACK_SIZE); - LONG($END + PATH_SIZE); - LONG($END); + LONG(AppParams); + LONG(AppPath); *(.text) *(.rdata) *(.data) diff --git a/programs/system/RunOD/1/RUN.asm b/programs/system/RunOD/1/RUN.asm index 824faebe0f..c1788027a5 100644 --- a/programs/system/RunOD/1/RUN.asm +++ b/programs/system/RunOD/1/RUN.asm @@ -315,6 +315,9 @@ Edit1 TEditBox <\ ; -------------------------------------------------------- ; .Data? ; ------------------------------------------------- ; ; -------------------------------------------------------- ; +Extern AppParams: Byte +Extern AppPath: Byte + BoxLib Dword ? ProcLib Dword ? @@ -347,7 +350,7 @@ ProcInfoBuffer Byte PROC_INFO_BUFFER_SIZE Dup (?) Edit1MouseVariable Dword ? Edit1TextBuffer Byte EDIT1_TEXT_BUFFER_SIZE + 2 Dup (?) ; buffer for Edit1.text -TmpBuffer Byte TMP_BUFFER_SIZE Dup (?) ; this buffer uses in StrInsert +TmpBuffer Byte TMP_BUFFER_SIZE Dup (?) ; this buffer uses in StrInsert ; -------------------------------------------------------- ; .Code ; -------------------------------------------------- ; ; -------------------------------------------------------- ; @@ -576,6 +579,10 @@ OnButtonBrowse Endp Invoke GetProcAddress, ProcLib, CStr("OpenDialog_start") mov OpenDialogStart, eax +; Copy command line parameters to EditBox +; Assume EDIT1_TEXT_BUFFER_SIZE > PARAMS_SIZE(defined in linker-script) + Invoke EditBoxSetText, Offset Edit1, Offset AppParams + ; it need for case if spaces are present in filepath lea eax, [OpenFilePathBuffer + 1] mov OD.openfile_path, eax