Subversion Repositories Kolibri OS

Rev

Rev 997 | Rev 1035 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 997 Rev 1000
Line 5... Line 5...
5
        dd      i_end
5
        dd      i_end
6
memsize dd      mem
6
memsize dd      mem
7
        dd      stacktop
7
        dd      stacktop
8
        dd      0, app_path
8
        dd      0, app_path
Line 9... Line 9...
9
 
9
 
10
version equ '0.6'
10
version equ '0.61'
Line 11... Line 11...
11
version_dword equ 0*10000h + 60
11
version_dword equ 0*10000h + 61
12
 
12
 
13
min_width = 54
13
min_width = 54
14
max_width = 255
14
max_width = 255
Line 158... Line 158...
158
        mov     [active_screen_vtable], ecx
158
        mov     [active_screen_vtable], ecx
159
        mov     [active_screen_keybar], keybar_panels
159
        mov     [active_screen_keybar], keybar_panels
160
; load libini.obj and kfar.ini
160
; load libini.obj and kfar.ini
161
        mov     eax, libini_name
161
        mov     eax, libini_name
162
        mov     esi, ini_import
162
        mov     esi, ini_import
163
        push    3
163
        push    6
164
        pop     ebp     ; we use version 3 of libini
164
        pop     ebp     ; we use version 6 of libini
165
        call    load_dll_and_import
165
        call    load_dll_and_import
166
        test    eax, eax
166
        test    eax, eax
167
        jnz     .noini
167
        jnz     .noini
168
        mov     edi, app_path
168
        mov     edi, app_path
169
        or      ecx, -1
169
        or      ecx, -1
Line 399... Line 399...
399
        push    ecx esi
399
        push    ecx esi
400
        call    [esi+PluginInfo.unload]
400
        call    [esi+PluginInfo.unload]
401
        pop     esi ecx
401
        pop     esi ecx
402
        jmp     .unload
402
        jmp     .unload
403
.unload_done:
403
.unload_done:
404
if 0    ; commented due to bug in libini
404
;if 0    ; commented due to bug in libini
405
        cmp     [ini.set_int], aIniSetInt
405
        cmp     [ini.set_int], aIniSetInt
406
        jz      .nosave
406
        jz      .nosave
407
        push    [panel1_colmode]
407
        push    [panel1_colmode]
408
        push    aLeftViewMode
408
        push    aLeftViewMode
409
        push    aPanels
409
        push    aPanels
Line 413... Line 413...
413
        push    aRightViewMode
413
        push    aRightViewMode
414
        push    aPanels
414
        push    aPanels
415
        push    app_path
415
        push    app_path
416
        call    [ini.set_int]
416
        call    [ini.set_int]
417
.nosave:
417
.nosave:
418
end if
418
;end if
419
if CHECK_FOR_LEAKS
419
if CHECK_FOR_LEAKS
420
        mov     ecx, [panel1_files]
420
        mov     ecx, [panel1_files]
421
        call    pgfree
421
        call    pgfree
422
        mov     ecx, [panel2_files]
422
        mov     ecx, [panel2_files]
423
        call    pgfree
423
        call    pgfree
Line 813... Line 813...
813
        cmp     al, 2
813
        cmp     al, 2
814
        setz    al
814
        setz    al
815
        ret
815
        ret
Line 816... Line 816...
816
 
816
 
817
enum_associations_callback:
817
enum_associations_callback:
818
; LongBool __stdcall callback(f_name,sec_name,key_name);
818
; LongBool __stdcall callback(f_name,sec_name,key_name,key_value);
819
; [esp+4] = f_name, [esp+8] = sec_name, [esp+12] = key_name
819
; [esp+4] = f_name, [esp+8] = sec_name, [esp+12] = key_name, [esp+16] = key_value
820
        mov     esi, [esp+12]
820
        mov     esi, [esp+12]
821
        mov     edi, esi
821
        mov     edi, esi
822
@@:
822
@@:
823
        lodsb
823
        lodsb
824
        test    al, al
824
        test    al, al
825
        jnz     @b
825
        jnz     @b
826
        sub     esi, edi        ; esi = size of key name
-
 
827
        push    nullstr
-
 
828
        push    1024
-
 
829
        push    saved_file_name
-
 
830
        push    edi
826
        sub     esi, edi        ; esi = size of key name
831
        push    dword [esp+16+8]
-
 
832
        push    dword [esp+20+4]
-
 
833
        call    [ini.get_str]
-
 
834
        test    eax, eax
-
 
835
        jnz     .ret
-
 
836
        mov     eax, saved_file_name
827
        mov     eax, [esp+16]
837
@@:
828
@@:
838
        inc     esi
829
        inc     esi
839
        inc     eax
830
        inc     eax
840
        cmp     byte [eax-1], 0
831
        cmp     byte [eax-1], 0
Line 868... Line 859...
868
@@:
859
@@:
869
        lodsb
860
        lodsb
870
        stosb
861
        stosb
871
        test    al, al
862
        test    al, al
872
        jnz     @b
863
        jnz     @b
873
        mov     esi, saved_file_name
864
        mov     esi, [esp+16]
874
@@:
865
@@:
875
        lodsb
866
        lodsb
876
        stosb
867
        stosb
877
        test    al, al
868
        test    al, al
878
        jnz     @b
869
        jnz     @b
879
.ret:
870
.ret:
880
        mov     al, 1
871
        mov     al, 1
881
        ret     12
872
        ret     16
882
.err:
873
.err:
883
        mov     ecx, edx
874
        mov     ecx, edx
884
        call    pgfree
875
        call    pgfree
885
        xor     eax, eax
876
        xor     eax, eax
886
        ret     12
877
        ret     16
Line 887... Line 878...
887
 
878
 
888
enum_plugins_callback:
879
enum_plugins_callback:
889
; LongBool __stdcall callback(f_name,sec_name,key_name);
880
; LongBool __stdcall callback(f_name,sec_name,key_name,key_value);
890
; [esp+4] = f_name, [esp+8] = sec_name, [esp+12] = key_name
-
 
891
        push    nullstr
-
 
892
        push    1024
-
 
893
        push    saved_file_name
-
 
894
        push    dword [esp+12+12]
881
; [esp+4] = f_name, [esp+8] = sec_name, [esp+12] = key_name, [esp+16] = key_value
895
        push    dword [esp+16+8]
-
 
896
        push    dword [esp+20+4]
-
 
897
        call    [ini.get_str]
-
 
898
        test    eax, eax
-
 
899
        jnz     .ret
-
 
900
        mov     esi, saved_file_name
882
        mov     esi, [esp+16]
901
        cmp     byte [esi], '/'
883
        cmp     byte [esi], '/'
902
        jz      .absolute
884
        jz      .absolute
903
; convert path to absolute
885
; convert path to absolute
904
        mov     edi, execdata
-
 
905
        push    esi
886
        mov     edi, execdata
-
 
887
@@:
-
 
888
        cmp     edi, execdata+1024
906
@@:
889
        jae     .overflow
907
        lodsb
890
        lodsb
908
        stosb
891
        stosb
909
        test    al, al
892
        test    al, al
-
 
893
        jnz     @b
910
        jnz     @b
894
        mov     edi, saved_file_name
911
        pop     edi
895
        mov     [esp+16], edi
912
        mov     esi, app_path
896
        mov     esi, app_path
913
        push    esi
897
        push    esi
914
        xor     ecx, ecx
898
        xor     ecx, ecx
915
@@:
899
@@:
Line 921... Line 905...
921
        mov     ecx, esi
905
        mov     ecx, esi
922
        jmp     @b
906
        jmp     @b
923
@@:
907
@@:
924
        pop     esi
908
        pop     esi
925
        sub     ecx, esi
909
        sub     ecx, esi
-
 
910
        push    edi
-
 
911
        add     edi, ecx
-
 
912
        cmp     edi, saved_file_name+1024
-
 
913
        pop     edi
-
 
914
        ja      .overflow
926
        rep     movsb
915
        rep     movsb
927
        mov     esi, execdata
916
        mov     esi, execdata
928
.z:
917
.z:
929
        cmp     word [esi], '.'
918
        cmp     word [esi], '.'
930
        jz      .ret
919
        jz      .ret
Line 946... Line 935...
946
        jbe     .ret
935
        jbe     .ret
947
        cmp     byte [edi-1], '/'
936
        cmp     byte [edi-1], '/'
948
        jnz     @b
937
        jnz     @b
949
        jmp     .z
938
        jmp     .z
950
.c:
939
.c:
-
 
940
        cmp     edi, saved_file_name+1024
-
 
941
        jae     .overflow
951
        lodsb
942
        lodsb
952
        stosb
943
        stosb
953
        test    al, al
944
        test    al, al
954
        jz      @f
945
        jnz     .c
955
        cmp     edi, saved_file_name+1024
946
        jmp     .absolute
956
        jb      .c
947
.overflow:
957
        mov     esi, execdata
948
        mov     esi, execdata
-
 
949
        mov     byte [esi+1023], 0
958
        call    load_dll_and_import.big
950
        call    load_dll_and_import.big
959
.ret:
951
.ret:
960
        mov     al, 1
952
        mov     al, 1
961
        ret     12
953
        ret     12
962
@@:
-
 
963
.absolute:
954
.absolute:
964
; allocate space for plugin info
955
; allocate space for plugin info
965
        mov     eax, [num_plugins]
956
        mov     eax, [num_plugins]
966
        inc     eax
957
        inc     eax
967
        mov     [num_plugins], eax
958
        mov     [num_plugins], eax
Line 983... Line 974...
983
.norealloc:
974
.norealloc:
984
        mov     esi, [plugins]
975
        mov     esi, [plugins]
985
        lea     esi, [esi+ecx-PluginInfo.size]
976
        lea     esi, [esi+ecx-PluginInfo.size]
986
; load plugin DLL
977
; load plugin DLL
987
        or      ebp, -1
978
        or      ebp, -1
988
        mov     eax, saved_file_name
979
        mov     eax, [esp+16]
989
        call    load_dll_and_import.do
980
        call    load_dll_and_import.do
990
        test    eax, eax
981
        test    eax, eax
991
        jnz     .dec_ret
982
        jnz     .dec_ret
992
; find exported functions
983
; find exported functions
993
        mov     eax, aVersion
984
        mov     eax, aVersion
Line 1002... Line 993...
1002
        cmp     eax, MAX_INTERFACE_VER
993
        cmp     eax, MAX_INTERFACE_VER
1003
        jbe     .version_ok
994
        jbe     .version_ok
1004
@@:
995
@@:
1005
        push    aIncompatibleVersion
996
        push    aIncompatibleVersion
1006
.cantload:
997
.cantload:
1007
        push    saved_file_name
998
        push    dword [esp+4+16]
1008
        push    aCannotLoadPlugin
999
        push    aCannotLoadPlugin
1009
        mov     eax, esp
1000
        mov     eax, esp
1010
        push    ContinueBtn
1001
        push    ContinueBtn
1011
        push    1
1002
        push    1
1012
        push    eax
1003
        push    eax
Line 1039... Line 1030...
1039
        ja      .dec_ret
1030
        ja      .dec_ret
1040
        push    aInitFailed
1031
        push    aInitFailed
1041
        jmp     .cantload
1032
        jmp     .cantload
1042
.ok:
1033
.ok:
1043
        mov     al, 1
1034
        mov     al, 1
1044
        ret     12
1035
        ret     16
Line 1045... Line 1036...
1045
 
1036
 
1046
plugin_unload_default:
1037
plugin_unload_default:
Line 1047... Line 1038...
1047
        ret
1038
        ret
Line 6382... Line 6373...
6382
        cmp     esi, ecx
6373
        cmp     esi, ecx
6383
        jb      .mask_done
6374
        jb      .mask_done
6384
        mov     al, [esi]
6375
        mov     al, [esi]
6385
        cmp     al, '*'
6376
        cmp     al, '*'
6386
        jz      .asterisk
6377
        jz      .asterisk
6387
        cmp     al, '?'
-
 
6388
        jz      .quest
-
 
6389
        cmp     al, ']'
-
 
6390
        jz      .list
-
 
6391
        dec     edi
6378
        dec     edi
6392
        cmp     edi, edx
6379
        cmp     edi, edx
6393
        jb      .done_fail
6380
        jb      .done_fail
-
 
6381
        cmp     al, '?'
-
 
6382
        jz      .mask_symbol
-
 
6383
        cmp     al, ']'
-
 
6384
        jz      .list_check
6394
        cmp     al, [edi]
6385
        cmp     al, [edi]
6395
        jz      .mask_symbol
6386
        jz      .mask_symbol
6396
.done_fail:
6387
.done_fail:
6397
        stc
6388
        stc
6398
        pop     eax edi esi
6389
        pop     eax edi esi
Line 6402... Line 6393...
6402
        jnz     .done_fail
6393
        jnz     .done_fail
6403
.done_succ:
6394
.done_succ:
6404
        clc
6395
        clc
6405
        pop     eax edi esi
6396
        pop     eax edi esi
6406
        ret
6397
        ret
6407
.quest:
-
 
6408
        dec     edi
-
 
6409
        cmp     edi, edx
-
 
6410
        jb      .done_fail
-
 
6411
        jmp     .mask_symbol
-
 
6412
.list:
-
 
6413
        dec     edi
-
 
6414
        cmp     edi, edx
-
 
6415
        jb      .done_fail
-
 
6416
.list_check:
6398
.list_check:
6417
        dec     esi
6399
        dec     esi
6418
        cmp     esi, ecx
6400
        cmp     esi, ecx
6419
        jbe     .done_fail
6401
        jbe     .done_fail
6420
        mov     al, [esi]
6402
        mov     al, [esi]
Line 6448... Line 6430...
6448
        cmp     byte [esi-1], '?'
6430
        cmp     byte [esi-1], '?'
6449
        jnz     @f
6431
        jnz     @f
6450
        cmp     edi, edx
6432
        cmp     edi, edx
6451
        jz      .done_fail
6433
        jz      .done_fail
6452
        dec     esi
6434
        dec     esi
-
 
6435
        dec     edi
6453
        jmp     .asterisk
6436
        jmp     .asterisk
6454
@@:
6437
@@:
6455
        cmp     byte [esi-1], ']'
6438
        cmp     byte [esi-1], ']'
6456
        jz      .asterisk_common
6439
        jz      .asterisk_common
6457
; the mask is ...*...
6440
; the mask is ...*...
6458
.asterisk_normal:
6441
.asterisk_normal:
6459
        mov     al, [esi-1]
6442
        mov     al, [esi-1]
6460
@@:
6443
@@:
-
 
6444
        dec     edi
6461
        cmp     edi, edx
6445
        cmp     edi, edx
6462
        jz      .done_fail
6446
        jb      .done_fail
6463
        cmp     al, [edi]
6447
        cmp     al, [edi]
6464
        jz      @f
-
 
6465
        dec     edi
-
 
6466
        jmp     @b
6448
        jnz     @b
6467
@@:
6449
@@:
6468
        dec     edi
-
 
6469
        dec     esi
6450
        dec     esi
6470
        call    match_single_mask_rev_lowercase
6451
        call    match_single_mask_rev_lowercase
6471
        jnc     .done_succ
6452
        jnc     .done_succ
6472
        inc     esi
6453
        inc     esi
6473
        jmp     .asterisk_normal
6454
        jmp     .asterisk_normal