Subversion Repositories Kolibri OS

Rev

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

Rev 3081 Rev 3363
Line 26... Line 26...
26
 
26
 
27
///////////////////////////
27
///////////////////////////
28
//   Çàïóñê ïðîãðàììû    //
28
//   Çàïóñê ïðîãðàììû    //
29
///////////////////////////
29
///////////////////////////
30
f70 run_file_70;
30
f70 run_file_70;
31
:int RunProgram(dword run_path, run_param)
31
signed int RunProgram(dword run_path, run_param)
32
{	
32
{	
33
    run_file_70.func = 7;
33
    run_file_70.func = 7;
34
    run_file_70.param1 = 
34
    run_file_70.param1 = 
35
    run_file_70.param3 = 
35
    run_file_70.param3 = 
Line 94... Line 94...
94
	$mov eax,70
94
	$mov eax,70
95
	$mov ebx,#read_file_70.func
95
	$mov ebx,#read_file_70.func
96
	$int 0x40
96
	$int 0x40
97
}
97
}
Line -... Line 98...
-
 
98
 
-
 
99
:int GetFile(dword buf, filesize, read_path)
-
 
100
{
-
 
101
	BDVK ReadFile_atr;
-
 
102
	dword rBuf=0;
-
 
103
	if (! GetFileInfo(read_path, #ReadFile_atr))
-
 
104
	{
-
 
105
		rBuf = malloc(ReadFile_atr.sizelo);	
-
 
106
		if (! ReadFile(0, ReadFile_atr.sizelo, rBuf, read_path))
-
 
107
		{
-
 
108
			ESDWORD[buf] = rBuf;
-
 
109
			ESDWORD[filesize] = ReadFile_atr.sizelo;
-
 
110
			return 1;
-
 
111
		}
-
 
112
	}
-
 
113
	free(rBuf);
-
 
114
	return 0;
-
 
115
}
98
 
116
 
99
////////////////////////////
117
////////////////////////////
100
//     Çàïèñàòü ôàéë      //
118
//     Çàïèñàòü ôàéë      //
101
////////////////////////////
119
////////////////////////////
102
f70 write_file_70; 
120
f70 write_file_70; 
Line 131... Line 149...
131
	$mov ebx,#read_dir_70.func
149
	$mov ebx,#read_dir_70.func
132
	$int 0x40
150
	$int 0x40
133
}
151
}
Line -... Line 152...
-
 
152
 
-
 
153
 
-
 
154
:int GetDir(dword dir_buf, file_count, path)
-
 
155
{
-
 
156
	dword buf, fcount, error;
-
 
157
	buf = malloc(32);
-
 
158
	error = ReadDir(0, buf, path);
-
 
159
	if (!error)
-
 
160
	{
-
 
161
		fcount = ESDWORD[buf+8];
-
 
162
		buf = realloc(buf, fcount+1*304+32);
-
 
163
		ReadDir(fcount, buf, path);
-
 
164
		if (!strcmp(".",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
-
 
165
		if (!strcmp("..",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
-
 
166
		ESDWORD[dir_buf] = buf;
-
 
167
		ESDWORD[file_count] = fcount;
-
 
168
	}
-
 
169
	return error;
-
 
170
}
134
 
171
 
135
 
172
 
136
///////////////////////////
173
///////////////////////////
137
//   Ïàðàìåòðû ôàéëà    //
174
//   Ïàðàìåòðû ôàéëà    //
138
///////////////////////////
-
 
139
f70 getinfo_file_70;
175
///////////////////////////
140
BDVK getinfo_file_info;
176
f70 getinfo_file_70;
141
:dword GetFileInfo(dword file_path)
177
:dword GetFileInfo(dword file_path, bdvk_struct)
142
{    
178
{    
143
    getinfo_file_70.func = 5;
179
    getinfo_file_70.func = 5;
144
    getinfo_file_70.param1 = 
180
    getinfo_file_70.param1 = 
145
    getinfo_file_70.param2 = 
181
    getinfo_file_70.param2 = 
146
    getinfo_file_70.param3 = 0;
182
    getinfo_file_70.param3 = 0;
147
    getinfo_file_70.param4 = #getinfo_file_info;
183
    getinfo_file_70.param4 = bdvk_struct;
148
    getinfo_file_70.rezerv = 0;
184
    getinfo_file_70.rezerv = 0;
149
    getinfo_file_70.name = file_path;
185
    getinfo_file_70.name = file_path;
150
    $mov eax,70
186
    $mov eax,70
Line 158... Line 194...
158
///////////////////////////
194
///////////////////////////
159
:int CopyFile(dword copy_from, copy_in)
195
:int CopyFile(dword copy_from, copy_in)
160
{
196
{
161
	BDVK CopyFile_atr;
197
	BDVK CopyFile_atr;
162
	dword cBufer=0;
198
	dword cBufer=0;
163
	
-
 
-
 
199
	char rezult = -1;
164
	if (! GetFileInfo(copy_from))
200
	if (! GetFileInfo(copy_from, #CopyFile_atr))
165
	{
201
	{
166
		mem_Init();
-
 
167
		cBufer = mem_Alloc(CopyFile_atr.sizelo);	
202
		cBufer = malloc(CopyFile_atr.sizelo);	
168
		if (! ReadFile(0, CopyFile_atr.sizelo, cBufer, copy_from))
203
		if (! ReadFile(0, CopyFile_atr.sizelo, cBufer, copy_from))
-
 
204
		{
169
			if (! WriteFile(CopyFile_atr.sizelo, cBufer, copy_in)) return 1;
205
			rezult = WriteFile(CopyFile_atr.sizelo, cBufer, copy_in);
170
	}
206
		}
171
	
-
 
172
	return 0;
-
 
173
}
207
	}
174
 
-
 
175
 
-
 
176
//Asper
-
 
177
void ReadAttributes(dword read_buffer, file_path)
-
 
178
{
-
 
179
	read_file_70.func = 5;
208
	free(cBufer);
180
	read_file_70.param1 = 0;
-
 
181
	read_file_70.param2 = 0;
-
 
182
	read_file_70.param3 = 0;
-
 
183
	read_file_70.param4 = read_buffer;
-
 
184
	read_file_70.rezerv = 0;
-
 
185
	read_file_70.name = file_path;
-
 
186
	$mov eax,70
209
	return rezult;
187
	$mov ebx,#read_file_70.func
-
 
188
	$int 0x40
-
 
189
}
210
}
Line 190... Line 211...
190
 
211
 
191
inline fastcall void SetCurDir( ECX)
212
inline fastcall void SetCurDir( ECX)
192
{
213
{