------------------------------------------------------------------------------- [BUG/PRB.] VFP 9.0 FIX - SAVING THE SETTING OF SET COLLATE TO MACHINE January 2024 ------------------------------------------------------------------------------- CCB 1. BUG: In vfp9 (and vfp6, vfp7, vfp8), we can save the current settings in the windows registry: Tools --> Options --> Set As Default For VFP 9.0, the current settings will be saved in the key HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\9.0\Options. For VFP Advanced 32-bit, the current settings will be saved in the key HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\10\Options. For VFP Advanced 64-bit, the current settings will be saved in the key HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro64\10\Options. But for the setting of SET COLLATE TO "MACHINE", it will not be saved in the windows registry (in fact, it will be saved as an empty string). 2. CAUSE: There are some BUGs in the following code. 3. RESOLUTION: We can write some code to fix the BUG. Label825972 :: mov eax , dword ptr [esi] ;0x00825972 : 8b06 mov ebx , dword ptr [ ebp + 0A4h ] ;0x00825974 : 8b9da4000000 mov ecx , dword ptr [ eax + 0140h ] ;0x0082597a : 8b8840010000 push ebx ;0x00825980 : 53 push edi ;0x00825981 : 57 shr ecx , 05h ;0x00825982 : c1e905 and ecx , 01h ;0x00825985 : 83e101 pushd 08766h ;0x00825988 : 6866870000 mov eax , offset Data94549c ;0x0082598d : b89c549400 call Fun8249e6 ;0x00825992 : e84ff0ffff mov eax , dword ptr [esi] ;0x00825997 : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x00825999 : 8b8080030000 push ebx ;0x0082599f : 53 push edi ;0x008259a0 : 57 and eax , 01h ;0x008259a1 : 83e001 push eax ;0x008259a4 : 50 mov dl , 016h ;0x008259a5 : b216 call Fun824553 ;0x008259a7 : e8a7ebffff mov eax , dword ptr [esi] ;0x008259ac : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x008259ae : 8b8080030000 push ebx ;0x008259b4 : 53 shr eax , 1 ;0x008259b5 : d1e8 push edi ;0x008259b7 : 57 and eax , 01h ;0x008259b8 : 83e001 push eax ;0x008259bb : 50 mov dl , 046h ;0x008259bc : b246 call Fun824553 ;0x008259be : e890ebffff mov eax , dword ptr [esi] ;0x008259c3 : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x008259c5 : 8b8080030000 push ebx ;0x008259cb : 53 shr eax , 02h ;0x008259cc : c1e802 push edi ;0x008259cf : 57 and eax , 01h ;0x008259d0 : 83e001 push eax ;0x008259d3 : 50 mov dl , 064h ;0x008259d4 : b264 call Fun824553 ;0x008259d6 : e878ebffff mov eax , dword ptr [esi] ;0x008259db : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x008259dd : 8b8080030000 push ebx ;0x008259e3 : 53 shr eax , 03h ;0x008259e4 : c1e803 push edi ;0x008259e7 : 57 and eax , 01h ;0x008259e8 : 83e001 push eax ;0x008259eb : 50 mov dl , 049h ;0x008259ec : b249 call Fun824553 ;0x008259ee : e860ebffff mov eax , dword ptr [esi] ;0x008259f3 : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x008259f5 : 8b8080030000 push ebx ;0x008259fb : 53 shr eax , 04h ;0x008259fc : c1e804 push edi ;0x008259ff : 57 and eax , 01h ;0x00825a00 : 83e001 push eax ;0x00825a03 : 50 mov dl , 017h ;0x00825a04 : b217 call Fun824553 ;0x00825a06 : e848ebffff mov eax , dword ptr [esi] ;0x00825a0b : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x00825a0d : 8b8080030000 push ebx ;0x00825a13 : 53 shr eax , 05h ;0x00825a14 : c1e805 push edi ;0x00825a17 : 57 and eax , 01h ;0x00825a18 : 83e001 push eax ;0x00825a1b : 50 mov dl , 05Fh ;0x00825a1c : b25f call Fun824553 ;0x00825a1e : e830ebffff mov eax , dword ptr [esi] ;0x00825a23 : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x00825a25 : 8b8080030000 push ebx ;0x00825a2b : 53 shr eax , 06h ;0x00825a2c : c1e806 push edi ;0x00825a2f : 57 and eax , 01h ;0x00825a30 : 83e001 push eax ;0x00825a33 : 50 mov dl , 01Eh ;0x00825a34 : b21e call Fun824553 ;0x00825a36 : e818ebffff mov eax , dword ptr [esi] ;0x00825a3b : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x00825a3d : 8b8080030000 push ebx ;0x00825a43 : 53 shr eax , 07h ;0x00825a44 : c1e807 push edi ;0x00825a47 : 57 and eax , 01h ;0x00825a48 : 83e001 push eax ;0x00825a4b : 50 mov dl , 0Fh ;0x00825a4c : b20f call Fun824553 ;0x00825a4e : e800ebffff mov eax , dword ptr [esi] ;0x00825a53 : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x00825a55 : 8b8080030000 push ebx ;0x00825a5b : 53 shr eax , 08h ;0x00825a5c : c1e808 push edi ;0x00825a5f : 57 and eax , 01h ;0x00825a60 : 83e001 push eax ;0x00825a63 : 50 mov dl , 061h ;0x00825a64 : b261 call Fun824553 ;0x00825a66 : e8e8eaffff mov eax , dword ptr [esi] ;0x00825a6b : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x00825a6d : 8b8080030000 push ebx ;0x00825a73 : 53 shr eax , 09h ;0x00825a74 : c1e809 push edi ;0x00825a77 : 57 and eax , 01h ;0x00825a78 : 83e001 push eax ;0x00825a7b : 50 mov dl , 036h ;0x00825a7c : b236 call Fun824553 ;0x00825a7e : e8d0eaffff mov eax , dword ptr [esi] ;0x00825a83 : 8b06 mov eax , dword ptr [ eax + 0380h ] ;0x00825a85 : 8b8080030000 push ebx ;0x00825a8b : 53 shr eax , 0Ah ;0x00825a8c : c1e80a push edi ;0x00825a8f : 57 and eax , 01h ;0x00825a90 : 83e001 push eax ;0x00825a93 : 50 mov dl , 07Bh ;0x00825a94 : b27b call Fun824553 ;0x00825a96 : e8b8eaffff mov eax , dword ptr [esi] ;0x00825a9b : 8b06 fld qword ptr [ eax + 0390h ] ;0x00825a9d : dd8090030000 push ecx ;0x00825aa3 : 51 push ecx ;0x00825aa4 : 51 fstp qword ptr [ esp ] ;0x00825aa5 : dd1c24 push ebx ;0x00825aa8 : 53 push edi ;0x00825aa9 : 57 push dword ptr [ eax + 0384h ] ;0x00825aaa : ffb084030000 call Fun8247f4 ;0x00825ab0 : e83fedffff mov eax , dword ptr [esi] ;0x00825ab5 : 8b06 push ebx ;0x00825ab7 : 53 push edi ;0x00825ab8 : 57 push dword ptr [ eax + 0388h ] ;0x00825ab9 : ffb088030000 pushd 027h ;0x00825abf : 6a27 call Fun8247a9 ;0x00825ac1 : e8e3ecffff mov eax , dword ptr [esi] ;0x00825ac6 : 8b06 push ebx ;0x00825ac8 : 53 push edi ;0x00825ac9 : 57 push dword ptr [ eax + 038Ch ] ;0x00825aca : ffb08c030000 pushd 043h ;0x00825ad0 : 6a43 call Fun8247a9 ;0x00825ad2 : e8d2ecffff mov eax , dword ptr [esi] ;0x00825ad7 : 8b06 mov ecx , dword ptr [ eax + 0380h ] ;0x00825ad9 : 8b8880030000 push ebx ;0x00825adf : 53 shr ecx , 0Bh ;0x00825ae0 : c1e90b push edi ;0x00825ae3 : 57 and ecx , 01h ;0x00825ae4 : 83e101 push ecx ;0x00825ae7 : 51 push dword ptr [ eax + 0398h ] ;0x00825ae8 : ffb098030000 call Fun82538a ;0x00825aee : e897f8ffff cmp dword ptr [ Data9388c0 ] , 00h ;0x00825af3 : 833dc088930000 je Label825b28 ;0x00825afa : 742c mov eax , ebx ;0x00825afc : 8bc3 and eax , 0FFFFFFFDh ;0x00825afe : 83e0fd push eax ;0x00825b01 : 50 mov eax , dword ptr [esi] ;0x00825b02 : 8b06 push edi ;0x00825b04 : 57 add eax , 039Ch ;0x00825b05 : 059c030000 ; ; -------------------------------------------------------------------- ; VFP 9.0 FIX - SAVING THE SETTING OF SET COLLATE TO MACHINE ; June 2016 ; -------------------------------------------------------------------- ; CCB ; ; We can save the current settings in the windows registry: ; Tools --> Options ---> Set As Default ; ; For VFP 9.0, the current settings will be saved in the key HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\9.0\Options. ; For VFP Advanced 32-bit, the current settings will be saved in the key HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\10\Options. ; For VFP Advanced 64-bit, the current settings will be saved in the key HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro64\10\Options. ; ; But for the setting of SET COLLATE TO "MACHINE", it will not be saved in the windows registry (in fact, it will be saved as an empty string). ; ; 2016/6/15, by ccb ; cmp byte ptr [eax],00h jne Label825b0a mov byte ptr [eax][0],"M" mov byte ptr [eax][1],"A" mov byte ptr [eax][2],"C" mov byte ptr [eax][3],"H" mov byte ptr [eax][4],"I" mov byte ptr [eax][5],"N" mov byte ptr [eax][6],"E" mov byte ptr [eax][7],00h Label825b0a :: push eax ;0x00825b0a : 50 mov dl , 06Bh ;0x00825b0b : b26b call Fun8243c7 ;0x00825b0d : e8b5e8ffff mov eax , ebx ;0x00825b12 : 8bc3 and eax , 0FFFFFFFEh ;0x00825b14 : 83e0fe push eax ;0x00825b17 : 50 mov eax , dword ptr [esi] ;0x00825b18 : 8b06 push edi ;0x00825b1a : 57 add eax , 039Ch ;0x00825b1b : 059c030000 push eax ;0x00825b20 : 50 mov dl , 06Bh ;0x00825b21 : b26b call Fun82446d ;0x00825b23 : e845e9ffff 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/6190c572-399a-41c4-9910-c6f737019bb2/index-problem-of-vfp-6-application-running-on-both-xp-and-vista 3, tech-archive.net: http://www.tech-archive.net/Archive/Fox/microsoft.public.fox.programmer.exchange/2007-11/msg00478.html 4, sunyear.com.tw: http://vfp.sunyear.com.tw/viewtopic.php?t=6686 6. OTHER: For reference only, there is no guarantees. Any questions or suggestions, please send me an email at ccb2000@163.com. |