Subversion Repositories Kolibri OS

Rev

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

Rev 1289 Rev 1304
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 1289 $
8
$Revision: 1304 $
9
 
9
 
Line 965... Line 965...
965
	xor	ebp, ebp
965
	xor	ebp, ebp
966
.ret:
966
.ret:
967
	ret
967
	ret
Line 968... Line 968...
968
 
968
 
969
sys_current_directory:
969
sys_current_directory:
970
	mov	esi, [current_slot]
970
;	mov	esi, [current_slot]
971
	mov	esi, [esi+APPDATA.cur_dir]
971
;	mov	esi, [esi+APPDATA.cur_dir]
-
 
972
;	mov	edx, esi
-
 
973
 
-
 
974
;get lenght string of appdata.cur_dir
-
 
975
;	mov	eax, [current_slot]
-
 
976
;	mov	edi, [eax+APPDATA.cur_dir]
972
	mov	edx, esi
977
 
973
	dec	eax
978
	dec	ebx
974
	jz	.set
979
	jz	.set
975
	dec	eax
980
	dec	ebx
976
	jz	.get
981
	jz	.get
977
	ret
982
	ret
978
.get:
983
.get:
979
; sysfunction 30.2: [for app] eax=30,ebx=2,ecx->buffer,edx=len
984
; sysfunction 30.2: [for app] eax=30,ebx=2,ecx->buffer,edx=len
-
 
985
; for our code: ebx->buffer,ecx=len
-
 
986
max_cur_dir	equ	0x1000
-
 
987
;get lenght string of appdata.cur_dir
-
 
988
	mov	eax, [current_slot]
980
; for our code: ebx->buffer,ecx=len
989
	mov	edi, [eax+APPDATA.cur_dir]
981
@@:
990
 
-
 
991
	mov	ebx,edi
982
	lodsb
992
 
983
	test	al, al
993
	push	ecx
-
 
994
	push	edi
984
	jnz	@b
995
 
985
	sub	esi, edx
996
	xor	eax,eax
-
 
997
	mov	ecx,max_cur_dir
986
	inc	esi
998
 
-
 
999
	repne	scasb		;find zerro at and string
-
 
1000
	jcxz    .error		;ecx=0 and destination buffer is too small.
987
	mov	[esp+36], esi
1001
 
988
	cmp	ecx, esi
1002
	sub	edi,ebx		;lenght for copy
989
	jbe	@f
1003
	inc	edi
990
	mov	ecx, esi
1004
        mov	[esp+32+8],edi	;return in eax
-
 
1005
 
991
@@:
1006
	cmp	edx,edi		;edi must have more than 2 (for / and 0x0)  
992
	cmp	ecx, 1
1007
;sourse string
993
	jbe	.ret
1008
	pop	esi
994
	mov	esi, edx
1009
;destination string
995
	mov	edi, ebx
1010
	pop	edi
-
 
1011
	jb	.ret
-
 
1012
 
996
	mov	al, '/'
1013
	mov	al,'/'		;start string with '/'
997
	stosb
1014
	stosb
998
	dec	ecx
1015
	mov	ecx,edx
999
	dec	ecx
1016
	rep	movsb           ;copy string
1000
	rep	movsb
1017
	xor	eax,eax
1001
	mov	byte [edi], 0
1018
	mov	byte [edi],al   ;set zerro
-
 
1019
.ret:	ret
-
 
1020
 
-
 
1021
.error: add	esp,8
1002
.ret:
1022
	or	dword [esp+32],-1	;error not found zerro at string ->[eax+APPDATA.cur_dir]
1003
	ret
1023
	ret
1004
.set:
1024
.set:
1005
; sysfunction 30.1: [for app] eax=30,ebx=1,ecx->string
1025
; sysfunction 30.1: [for app] eax=30,ebx=1,ecx->string
1006
; for our code: ebx->string to set
1026
; for our code: ebx->string to set
1007
; use generic resolver with APPDATA.cur_dir as destination
1027
; use generic resolver with APPDATA.cur_dir as destination
-
 
1028
	push	max_cur_dir	;0x1000
1008
	push	0x1000
1029
	push	edi	;destination
1009
	push	edx
1030
	mov	ebx,ecx
1010
	call	get_full_file_name
1031
	call	get_full_file_name
Line 1011... Line 1032...
1011
	ret
1032
	ret
1012
 
1033