--------------------------------------------------------------------------------------------------
[BUG/PRB.] VFP 9.0 FIX - THE NUMBER OF TIMES TO TRY AGAIN AFTER OPENING CLIPBOARD FAILED
January 2026
--------------------------------------------------------------------------------------------------
CCB
1. BUG:
In vfp9 (and vfp6, vfp7, vfp8), somtimes the open clipboard command fails on Windows 10 or later.
2. CAUSE:
There are some compatible problems when the open clipboard command calls the OpenClipboard Windows API
for the Clipboard User Service or other programs.
Now if the open clipboard command calling the OpenClipboard Windows API failed,
it will call the OpenClipboard Windows API many times again.
There are some BUGs in the following code.
3. RESOLUTION:
We can write some code to fix the BUG.
Fun8a63a7 :: ; proc near
push ebp ;0x008a63a7 : 55
mov ebp , esp ;0x008a63a8 : 8bec
sub esp , 054h ;0x008a63aa : 83ec54
and dword ptr [ Data9382a0 ] , 00h ;0x008a63ad : 8325a082930000
push esi ;0x008a63bb : 56
;
; -------------------------------------------------------------------------------------------------
; VFP 9.0 FIX - SYS(9121) THE NUMBER OF TIMES TO TRY AGAIN AFTER OPENING CLIPBOARD FAILED
; March 2023
; -------------------------------------------------------------------------------------------------
; CCB
;
; SYS(9121) - The number of times to try again after opening clipboard failed.
;
; 2023/3/7, by ccb
;
; mov eax , dword ptr [ Data937fb4 ] ;0x008a63b4 : a1b47f9300
; mov eax , dword ptr [eax] ;0x008a63b9 : 8b00
; push dword ptr [eax] ;0x008a63bc : ff30
; call OpenClipboard ;0x008a63be : ff1558739100
mov dword ptr vfpa_openclipboard_openclipboard_cnt,00h
Label8a63c3 ::
mov eax , dword ptr [ Data937fb4 ]
mov eax , dword ptr [eax]
push dword ptr [eax]
call OpenClipboard
test eax , eax
jne Label8a63c4
mov ecx,dword ptr vfpa_sys9121_data
inc dword ptr vfpa_openclipboard_openclipboard_cnt
cmp dword ptr vfpa_openclipboard_openclipboard_cnt,ecx
ja Label8a63c4
push dword ptr vfpa_sys9074_data
call Sleep
jmp Label8a63c3
Label8a63c4 ::
test eax , eax ;0x008a63c4 : 85c0
je Label8a6465 ;0x008a63c6 : 0f8499000000
lea edx , dword ptr [ ebp - 4 ] ;0x008a63cc : 8d55fc
lea eax , dword ptr [ ebp - 84 ] ;0x008a63cf : 8d45ac
call Fun42c27f ;0x008a63d2 : e8a85eb8ff
pushd 00h ;0x008a63d7 : 6a00
push eax ;0x008a63d9 : 50
call Fun42c2be ;0x008a63da : e8df5eb8ff
test eax , eax ;0x008a63df : 85c0
pop ecx ;0x008a63e1 : 59
pop ecx ;0x008a63e2 : 59
jne Label8a6453 ;0x008a63e3 : 756e
pushd 01h ;0x008a63e5 : 6a01
call GetClipboardData ;0x008a63e7 : ff155c749100
mov esi , eax ;0x008a63ed : 8bf0
test esi , esi ;0x008a63ef : 85f6
jne Label8a6409 ;0x008a63f1 : 7516
mov eax , dword ptr [ Data9382a0 ] ;0x008a63f3 : a1a0829300
pushd 01012h ;0x008a63f8 : 6812100000
call Fun42bf2a ;0x008a63fd : e8285bb8ff
mov dword ptr [ Data9382a8 ] , eax ;0x008a6402 : a3a8829300
jmp Label8a6453 ;0x008a6407 : eb4a
Label8a6409 ::
pushd 05012h ;0x008a6409 : 6812500000
push esi ;0x008a640e : 56
call GlobalSize ;0x008a640f : ff15c0719100
call Fun42bf2a ;0x008a6415 : e8105bb8ff
push esi ;0x008a641a : 56
mov dword ptr [ Data9382a8 ] , eax ;0x008a641b : a3a8829300
call GlobalLock ;0x008a6420 : ff15b8719100
mov ecx , dword ptr [ Data9382a8 ] ;0x008a6426 : 8b0da8829300
mov ecx , dword ptr [ecx] ;0x008a642c : 8b09
jmp Label8a6439 ;0x008a642e : eb09
Label8a6430 ::
cmp dl , 0Ah ;0x008a6430 : 80fa0a
je Label8a6438 ;0x008a6433 : 7403
mov byte ptr [ecx] , dl ;0x008a6435 : 8811
inc ecx ;0x008a6437 : 41
Label8a6438 ::
inc eax ;0x008a6438 : 40
Label8a6439 ::
mov dl , byte ptr [eax] ;0x008a6439 : 8a10
test dl , dl ;0x008a643b : 84d2
jne Label8a6430 ;0x008a643d : 75f1
mov eax , dword ptr [ Data9382a8 ] ;0x008a643f : a1a8829300
sub ecx , dword ptr [eax] ;0x008a6444 : 2b08
push esi ;0x008a6446 : 56
mov dword ptr [ Data9382a0 ] , ecx ;0x008a6447 : 890da0829300
call GlobalUnlock ;0x008a644d : ff15b4719100
Label8a6453 ::
lea eax , dword ptr [ ebp - 4 ] ;0x008a6453 : 8d45fc
push eax ;0x008a6456 : 50
lea eax , dword ptr [ ebp - 84 ] ;0x008a6457 : 8d45ac
call Fun42d200 ;0x008a645a : e8a16db8ff
call CloseClipboard ;0x008a645f : ff1560739100
Label8a6465 ::
mov eax , dword ptr [ Data9382a0 ] ;0x008a6465 : a1a0829300
pop esi ;0x008a646a : 5e
leave ;0x008a646b : c9
ret ;0x008a646c : c3
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
http://www.baiyujia.com/vfpdocuments/f_vfp9fix247.asp
2, microsoft.com:
https://devblogs.microsoft.com/oldnewthing/20041101-00/?p=37433
3, foxite.com:
https://www.foxite.com/archives/vfp-bug-and-how-to-fix-it-0000493666.htm
6. OTHER:
For reference only, there is no guarantees.
Any questions or suggestions, please send me an email at ccb2000@163.com.
|