------------------------------------------------------------
[ENHANCED] VFP 9.0 FIX - THE COMMAND-LINE OPTIONS
January 2026
------------------------------------------------------------
CCB
1. BUG:
In vfp9 (and vfp6, vfp7, vfp8), the command-line options can only use <= 255 bytes, now it can use <= 8191 bytes.
Usually, we can pass a maximum of 26 parameters from the command-line options.
2. CAUSE:
There are some BUGs in the following code.
3. RESOLUTION:
We can write some code to fix the BUG.
Fun403e79 :: ; proc near
push ebp ;0x00403e79 : 55
mov ebp , esp ;0x00403e7a : 8bec
sub esp , 05Ch ;0x00403e7c : 83ec5c
mov eax , dword ptr [ ebp + 8 ] ;0x00403e7f : 8b4508
cmp byte ptr [eax] , 00h ;0x00403e82 : 803800
push ebx ;0x00403e85 : 53
push esi ;0x00403e86 : 56
mov esi , dword ptr [ ebp + 12 ] ;0x00403e87 : 8b750c
push edi ;0x00403e8a : 57
je Label403f1c ;0x00403e8b : 0f848b000000
lea ecx , dword ptr [ eax + 1 ] ;0x00403e91 : 8d4801
Label403e94 ::
mov dl , byte ptr [eax] ;0x00403e94 : 8a10
inc eax ;0x00403e96 : 40
test dl , dl ;0x00403e97 : 84d2
jne Label403e94 ;0x00403e99 : 75f9
sub eax , ecx ;0x00403e9b : 2bc1
;
; -------------------------------------------------
; VFP 9.0 FIX - THE COMMAND-LINE OPTIONS
; July 2019
; -------------------------------------------------
; CCB
;
; In vfp9, the command-line options can only use <= 255 bytes, now it can use <= 8191 bytes.
;
; 2019/7/10, by ccb
;
; mov ebx , 0100h ;0x00403e9d : bb00010000
mov ebx , 02000h ;0x00403e9d : bb00010000
lea ecx , dword ptr [ esi + 0842h ] ;0x00403ea2 : 8d8e42080000
mov edx , ebx ;0x00403ea8 : 8bd3
mov dword ptr [ ebp - 8 ] , eax ;0x00403eaa : 8945f8
;
; -------------------------------------------------
; VFP 9.0 FIX - THE COMMAND-LINE OPTIONS
; July 2019
; -------------------------------------------------
; CCB
;
; In vfp9, the command-line options can only use <= 255 bytes, now it can use <= 8191 bytes.
;
; 2019/7/10, by ccb
;
; lea edi , dword ptr [ esi + 0942h ] ;0x00403ead : 8dbe42090000
lea edi , dword ptr [ esi - 2000h ] ;0x00403ead : 8dbe42090000
call Fun41b81c ;0x00403eb3 : e864790100
mov edx , ebx ;0x00403eb8 : 8bd3
mov ecx , edi ;0x00403eba : 8bcf
mov dword ptr [ ebp - 4 ] , eax ;0x00403ebc : 8945fc
call Fun41b81c ;0x00403ebf : e858790100
mov ecx , dword ptr [ ebp - 4 ] ;0x00403ec4 : 8b4dfc
add ecx , dword ptr [ ebp - 8 ] ;0x00403ec7 : 034df8
add eax , ecx ;0x00403eca : 03c1
cmp eax , ebx ;0x00403ecc : 3bc3
jnl Label403f16 ;0x00403ece : 7d46
mov eax , dword ptr [ esi + 0A50h ] ;0x00403ed0 : 8b86500a0000
xor edi , edi ;0x00403ed6 : 33ff
cmp eax , edi ;0x00403ed8 : 3bc7
je Label403f23 ;0x00403eda : 7447
cmp dword ptr [ Data93a7fc ] , 03h ;0x00403edc : 833dfca7930003
je Label5773eb ;0x00403ee3 : 0f8402351700
cmp eax , 01h ;0x00403ee9 : 83f801
mov eax , offset Data918008 ;0x00403eec : b808809100
je Label403ef8 ;0x00403ef1 : 7405
mov eax , offset Data918004 ;0x00403ef3 : b804809100
Label403ef8 ::
push eax ;0x00403ef8 : 50
;
; -------------------------------------------------
; VFP 9.0 FIX - THE COMMAND-LINE OPTIONS
; July 2019
; -------------------------------------------------
; CCB
;
; In vfp9, the command-line options can only use <= 255 bytes, now it can use <= 8191 bytes.
;
; 2019/7/10, by ccb
;
; lea edi , dword ptr [ esi + 0942h ] ;0x00403ef9 : 8dbe42090000
lea edi , dword ptr [ esi - 2000h ] ;0x00403ef9 : 8dbe42090000
call Fun42e055 ;0x00403eff : e851a10200
push dword ptr [ ebp + 8 ] ;0x00403f04 : ff7508
call Fun42e055 ;0x00403f07 : e849a10200
pushd offset Data917f4c ;0x00403f0c : 684c7f9100
Label403f11 ::
call Fun42e055 ;0x00403f11 : e83fa10200
Label403f16 ::
inc dword ptr [ esi + 0A50h ] ;0x00403f16 : ff86500a0000
Label403f1c ::
pop edi ;0x00403f1c : 5f
pop esi ;0x00403f1d : 5e
pop ebx ;0x00403f1e : 5b
leave ;0x00403f1f : c9
ret 08h ;0x00403f20 : c20800
4. APPLIES TO:
VFP 6.0.8167.0
VFP 6.0.8961.0 (SP5)
VFP 7.0.0.9262
VFP 7.0.0.9465 (SP1)
VFP 8.0.0.2521
VFP 8.0.0.3117 (SP1)
VFP 9.0.0.2412
VFP 9.0.0.3504 (SP1)
VFP 9.0.0.4611 (SP2)
VFP 9.0.0.5015 (SP2)
VFP 9.0.0.5411 (SP2)
VFP 9.0.0.5721 (SP2)
VFP 9.0.0.5815 (SP2)
VFP 9.0.0.6303 (SP2)
VFP 9.0.0.6602 (SP2)
VFP 9.0.0.7423 (SP2)
The bug has been fixed in VFP Advanced.
5. REFERENCE WEBSITES:
1, baiyujia.com:
http://www.baiyujia.com
2, microsoft.com:
https://social.msdn.microsoft.com/Forums/en-US/feeea559-4183-4fed-9081-3879e0d087de/command-line-parameters-length-limitation
https://devblogs.microsoft.com/oldnewthing/?p=41553
3, tek-tips.com:
https://www.tek-tips.com/viewthread.cfm?qid=1062921
https://www.tek-tips.com/viewthread.cfm?qid=1752644
4, berezniker.com:
https://www.berezniker.com/content/pages/visual-foxpro/how-pass-parameters-vfp-exe
6. OTHER:
For reference only, there is no guarantees.
Any questions or suggestions, please send me an email at ccb2000@163.com.
|