From 1af612e4d2e7c9fac8937b527525b1eb2bcae95b Mon Sep 17 00:00:00 2001 From: "Mihail Semenyako (mike.dld)" Date: Tue, 11 Nov 2008 20:05:59 +0000 Subject: [PATCH] Fixed major issue in libini (set_* affected) connected with wrong parameters to file.seek Commented out wildcards test from test001 (function is no longer exported thus can't be tested) git-svn-id: svn://kolibrios.org@919 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../libraries/libs-dev/.test/001/test001.asm | 4 ++- .../libraries/libs-dev/libini/libini.asm | 5 ++-- .../libraries/libs-dev/libini/libini_p.asm | 28 +++++++++---------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/programs/develop/libraries/libs-dev/.test/001/test001.asm b/programs/develop/libraries/libs-dev/.test/001/test001.asm index 5e232e662b..08724e6d93 100644 --- a/programs/develop/libraries/libs-dev/.test/001/test001.asm +++ b/programs/develop/libraries/libs-dev/.test/001/test001.asm @@ -137,6 +137,7 @@ START: or eax,eax jnz exit +@^ ; commenting out, file.aux.match_wildcard is no longer exported mov esi,_str1 + 4 mov edi,_str2 + 4 mov ecx,_str3 @@ -152,6 +153,7 @@ START: add ecx,4 cmp dword[esi-4],0 jnz @b +^@ invoke ini.set_int,s_ini,s_sec,s_key1,100 invoke ini.set_int,s_ini,s_sec,s_key2,101 @@ -382,7 +384,7 @@ import libini, \ ini.enum_keys,'ini.enum_keys' import libio, \ - file.aux.match_wildcard,'file.aux.match_wildcard',\ +\; file.aux.match_wildcard,'file.aux.match_wildcard',\ file.find_first,'file.find_first',\ file.find_next,'file.find_next',\ file.find_close,'file.find_close',\ diff --git a/programs/develop/libraries/libs-dev/libini/libini.asm b/programs/develop/libraries/libs-dev/libini/libini.asm index 5963debaf2..7bfab65722 100644 --- a/programs/develop/libraries/libs-dev/libini/libini.asm +++ b/programs/develop/libraries/libs-dev/libini/libini.asm @@ -102,7 +102,7 @@ endl lea ebx, [f] mov [f_addr], ebx - invoke file.seek, [f.fh], SEEK_SET, 0 + invoke file.seek, [f.fh], 0, SEEK_SET stdcall libini._.preload_block, [f_addr] .next_section: @@ -382,7 +382,6 @@ endl jnz .create_key .modify_key: - stdcall libini._.get_value_length, [f_addr] sub eax, [_buf_len] stdcall libini._.shift_content, [f_addr], eax @@ -391,7 +390,7 @@ endl invoke file.tell, [f.fh] sub eax, [f.cnt] ; dec eax - invoke file.seek, [f.fh], SEEK_SET, eax + invoke file.seek, [f.fh], eax, SEEK_SET invoke file.write, [f.fh], [_buffer], [_buf_len] pop edi esi ebx diff --git a/programs/develop/libraries/libs-dev/libini/libini_p.asm b/programs/develop/libraries/libs-dev/libini/libini_p.asm index 19d295bd7b..6484cd2525 100644 --- a/programs/develop/libraries/libs-dev/libini/libini_p.asm +++ b/programs/develop/libraries/libs-dev/libini/libini_p.asm @@ -176,7 +176,7 @@ proc libini._.unload_block _f ;///////////////////////////////////////////////// mov ebx, [_f] mov eax, [ebx + IniFile.pos] add eax, -ini.BLOCK_SIZE - invoke file.seek, [ebx + IniFile.fh], SEEK_SET, eax + invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET stdcall libini._.preload_block, ebx add esi, eax ; ini.BLOCK_SIZE mov [ebx + IniFile.cnt], 0 @@ -228,7 +228,7 @@ proc libini._.reload_block _f ;///////////////////////////////////////////////// mov ebx, [_f] push [ebx + IniFile.bsize] push esi [ebx + IniFile.cnt] - invoke file.seek, [ebx + IniFile.fh], SEEK_SET, [ebx + IniFile.pos] + invoke file.seek, [ebx + IniFile.fh], [ebx + IniFile.pos], SEEK_SET stdcall libini._.preload_block, ebx pop [ebx + IniFile.cnt] esi pop eax @@ -276,8 +276,8 @@ endl ; push eax sub eax, ecx ; dec eax - invoke file.seek, ebx, SEEK_SET, eax - @@: invoke file.seek, ebx, SEEK_CUR, [_delta] + invoke file.seek, ebx, eax, SEEK_SET + @@: invoke file.seek, ebx, [_delta], SEEK_CUR invoke file.eof?, ebx or eax, eax jnz .done @@ -285,14 +285,14 @@ endl mov ecx, eax mov eax, [_delta] neg eax - sub eax,ecx;ini.BLOCK_SIZE - invoke file.seek,ebx,SEEK_CUR,eax - invoke file.write,ebx,[buf],ecx;ini.BLOCK_SIZE + sub eax, ecx;ini.BLOCK_SIZE + invoke file.seek, ebx, eax, SEEK_CUR + invoke file.write, ebx, [buf], ecx;ini.BLOCK_SIZE jmp @b .done: mov eax, [_delta] neg eax - invoke file.seek, ebx, SEEK_CUR, eax + invoke file.seek, ebx, eax, SEEK_CUR invoke file.seteof, ebx ; pop eax ; invoke file.seek, ebx, SEEK_SET;, eax @@ -317,7 +317,7 @@ endl sub eax, ecx lea edx, [eax - 1] push edx - @@: invoke file.seek, ebx, SEEK_SET, edx + @@: invoke file.seek, ebx, edx, SEEK_SET invoke file.eof?, ebx or eax, eax jnz @f @@ -328,12 +328,12 @@ endl add edx, -ini.BLOCK_SIZE cmp edx, [esp] jl @f - invoke file.seek, ebx, SEEK_SET, edx + invoke file.seek, ebx, edx, SEEK_SET invoke file.read, ebx, [buf], ini.BLOCK_SIZE mov ecx, eax mov eax, [_delta] sub eax, ecx - invoke file.seek, ebx, SEEK_CUR, eax + invoke file.seek, ebx, eax, SEEK_CUR invoke file.write, ebx, [buf], ecx jmp @b @@: @@ -372,8 +372,8 @@ proc libini._.get_value_length _f ;///////////////////////////////////////////// sub eax, edx mov [esp + 4 * 3], eax -; pop eax - invoke file.seek, [ebx + IniFile.fh], SEEK_SET;, eax + pop eax + invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET stdcall libini._.preload_block, [_f] pop [ebx + IniFile.cnt] esi pop eax edx ecx ebx @@ -442,7 +442,7 @@ proc libini._.find_section _f, _sec_name ;////////////////////////////////////// push ebx edi mov ecx, [_f] - invoke file.seek, [ecx + IniFile.fh], SEEK_SET, 0 + invoke file.seek, [ecx + IniFile.fh], 0, SEEK_SET stdcall libini._.preload_block, [_f] .next_section: