Subversion Repositories Kolibri OS

Rev

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

Rev 134 Rev 139
Line 16... Line 16...
16
    invoke GetFileSize,eax,NULL
16
    invoke GetFileSize,eax,NULL
17
  .ex:
17
  .ex:
18
    mov  ebx,eax
18
    mov  ebx,eax
19
    mov  [filesize],eax
19
    mov  [filesize],eax
20
else
20
else
-
 
21
    and  dword [attrinfo+32], 0
21
    mcall 58,Finfo
22
    mcall 70,attrinfo
-
 
23
    mov  eax,[attrinfo+32]
22
    mov  [filesize],ebx
24
    mov  [filesize],ebx
-
 
25
    mcall 70,Finfo
23
end if
26
end if
24
    ret
27
    ret
Line 25... Line 28...
25
 
28
 
26
ResetFile:
29
ResetFile:
Line 35... Line 38...
35
FileSeek:
38
FileSeek:
36
; eax - offset
39
; eax - offset
37
; esi - current pointer (in memory!)
40
; esi - current pointer (in memory!)
38
; ebx - translation method: 0 - beginning, 1 - current, 2 - end
41
; ebx - translation method: 0 - beginning, 1 - current, 2 - end
39
    push eax ecx edx
42
    push eax ecx edx
40
    mov  edx,[Finfo.block]
-
 
41
    imul edx,BSIZE
-
 
42
    sub  esi,BUFPTR
43
    sub  esi,BUFPTR
43
    add  esi,edx
44
    add  esi,[Finfo.block]
44
    cmp  ebx,1
45
    cmp  ebx,1
45
    je   .cur
46
    je   .cur
46
    jb   .begin
47
    jb   .begin
47
    mov  esi,[filesize]
48
    mov  esi,[filesize]
48
    not  eax
49
    not  eax
49
  .cur:
50
  .cur:
50
    add  eax,esi
51
    add  eax,esi
51
  .begin:
52
  .begin:
52
    mov  ecx,BSIZE
53
    mov  esi,BUFPTR
53
    xor  edx,edx
-
 
54
    div  ecx
-
 
55
    lea  esi,[BUFPTR+edx]
-
 
56
    mov  [Finfo.block],eax
54
    mov  [Finfo.block],eax
57
if SYS eq win
55
if SYS eq win
58
    mul  ecx
-
 
59
    invoke SetFilePointer,[hnd],eax,NULL,FILE_BEGIN
56
    invoke SetFilePointer,[hnd],eax,NULL,FILE_BEGIN
60
    invoke ReadFile,[hnd],area,INBUF, os_work, NULL
57
    invoke ReadFile,[hnd],area,INBUF, os_work, NULL
61
;    add  [byte_count],area
58
;    add  [byte_count],area
62
else
59
else
63
;    pregs
60
;    pregs
64
;    wait
61
;    wait
65
    mov  [Finfo.count],BUFSIZE*2
62
    mov  [Finfo.count],BUFSIZE*1024
66
    mcall 58,Finfo
63
    mcall 70,Finfo
67
;    mov  [byte_count],area+INBUF
64
;    mov  [byte_count],area+INBUF
68
end if
65
end if
69
    pop  edx ecx eax
66
    pop  edx ecx eax
70
    ret
67
    ret
Line 103... Line 100...
103
   	invoke FindWindowEx, eax,NULL,NULL,ok_txt
100
   	invoke FindWindowEx, eax,NULL,NULL,ok_txt
104
   	invoke SendMessage,eax,BM_CLICK,NULL,NULL
101
   	invoke SendMessage,eax,BM_CLICK,NULL,NULL
105
 else
102
 else
106
    test [Flags],THREAD_YES
103
    test [Flags],THREAD_YES
107
    jnz  .ex
104
    jnz  .ex
108
    mcall 51,1,thread,child_stack;MEMORY
105
    mcall 51,1,thread,child_stack_top;MEMORY
109
    mov  [child],eax
106
    mov  [child],eax
110
 end if
107
 end if
111
  .ex:	
108
  .ex:	
112
	   ret
109
	   ret
Line 247... Line 244...
247
  .noend:
244
  .noend:
248
    cmp  al,' '
245
    cmp  al,' '
249
    je   .stay
246
    je   .stay
250
    cmp  al,'/'
247
    cmp  al,'/'
251
    jne  .yespar
248
    jne  .yespar
252
    mov  ecx,255
-
 
253
    dec  esi
249
    dec  esi
254
    mov  edi,filename
-
 
255
    xor  al,al
-
 
256
    rep  stosb
-
 
257
    mov  ecx,255
250
    mov  ecx,255
258
    mov  edi,filename
251
    mov  edi,filename
259
    rep  movsb
252
    rep  movsb
260
;    test [Flags],LIST_MODE
-
 
261
;    jz   again
-
 
262
    xor  eax,eax
-
 
263
    mov  edi,filename
-
 
264
    mov  ecx,255
-
 
265
    repne scasb
-
 
266
    cmp  byte[edi-2],'/'
-
 
267
    je   .slash
-
 
268
    mov  byte[edi-1],'/'
-
 
269
    inc  edi
-
 
270
  .slash:
-
 
271
;    Dump filename,255,os_work
-
 
272
;    ud2
-
 
273
    mov  ecx,edi
-
 
274
;    dec  ecx
-
 
275
    mov  edx,ecx
-
 
276
    mov  dword[Finfo],13
-
 
277
;    mov  dword[Finfo.count],1
-
 
278
    mov  edi,filename+5
-
 
279
    sub  ecx,edi
-
 
280
  .lp:
-
 
281
    mov  al,'/'
-
 
282
    repne scasb
-
 
283
;    jne  .ex
-
 
284
;    dpd  ecx
-
 
285
    and  byte[edi-1],0
-
 
286
    mcall 58,Finfo
-
 
287
    mov  byte[edi-1],'/'
-
 
288
    test ebx,32
-
 
289
    jz   .lp
-
 
290
    test [Flags],LIST_MODE
-
 
291
    jne  .listm
-
 
292
    and  byte[edi-1],0
-
 
293
;    Dump filename,255,os_work
-
 
294
    jmp  .agg
-
 
295
;    ud2
-
 
296
  .listm:
-
 
297
    lea  esi,[edi-1+ecx]
-
 
298
    lea  edi,[esi+1]
-
 
299
    std
-
 
300
    rep  movsb
-
 
301
    and  byte[edi],0
-
 
302
    cld
-
 
303
;    dpd  filename
-
 
304
 
-
 
305
    inc  edi
-
 
306
    dpd  edi
-
 
307
    cmp  edx,edi
-
 
308
    jne  .slash2
-
 
309
;    cmp  byte[edi],'/'
-
 
310
;    je   .slash2
-
 
311
    mov  byte[edi],'/'
-
 
312
    inc  edx
-
 
313
  .slash2:
-
 
314
    sub  edx,edi
-
 
315
    mov  [lpath],edi
-
 
316
    mov  [lpath_len],edx
-
 
317
    dpd  edx
-
 
318
  .agg:
-
 
319
    mov  dword[Finfo],0
-
 
320
;    ud2
-
 
321
    jmp  again;cmdl
253
    jmp  again;cmdl
322
  .yespar:
254
  .yespar:
323
    cmp  al,'N'
255
    cmp  al,'N'
324
    jne  .nonum
256
    jne  .nonum
325
    call get_6ASCII_num
257
    call get_6ASCII_num