Subversion Repositories Kolibri OS

Rev

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

Rev 7577 Rev 8083
Line 83... Line 83...
83
;
83
;
84
;edit_box_draw   dd      aEdit_box_draw
84
;edit_box_draw   dd aEdit_box_draw
85
;edit_box_key    dd      aEdit_box_key
85
;edit_box_key    dd aEdit_box_key
86
;edit_box_mouse  dd      aEdit_box_mouse
86
;edit_box_mouse  dd aEdit_box_mouse
87
;version_ed      dd      aVersion_ed
87
;version_ed      dd aVersion_ed
88
;
-
 
89
;check_box_draw  dd      aCheck_box_draw
-
 
90
;check_box_mouse dd      aCheck_box_mouse
-
 
91
;version_ch      dd      aVersion_ch
-
 
92
;
-
 
93
;option_box_draw  dd      aOption_box_draw
-
 
94
;option_box_mouse dd      aOption_box_mouse
-
 
95
;version_op       dd      aVersion_op
-
 
96
 
-
 
97
;                dd      0
88
;                dd 0,0
98
;                dd      0
-
 
99
;
-
 
100
;aEdit_box_draw  db 'edit_box',0
89
;aEdit_box_draw  db 'edit_box',0
101
;aEdit_box_key   db 'edit_box_key',0
90
;aEdit_box_key   db 'edit_box_key',0
102
;aEdit_box_mouse db 'edit_box_mouse',0
91
;aEdit_box_mouse db 'edit_box_mouse',0
103
;aVersion_ed     db 'version_ed',0
92
;aVersion_ed     db 'version_ed',0
Line 104... Line -...
104
 
-
 
105
;aCheck_box_draw  db 'check_box_draw',0
-
 
106
;aCheck_box_mouse db 'check_box_mouse',0
-
 
107
;aVersion_ch      db 'version_ch',0
-
 
108
 
-
 
109
;aOption_box_draw  db 'option_box_draw',0
-
 
110
;aOption_box_mouse db 'option_box_mouse',0
-
 
Line 111... Line -...
111
;aVersion_op       db 'version_op',0
-
 
-
 
93
 
112
 
94
 
113
;---------------------------------------------------------------------
95
 
114
macro @use_library
96
macro @use_library
115
{
97
{
116
local lp1
98
local lp1
Line 134... Line 116...
134
	.Flags dd ?
116
	.Flags dd ?
135
	.Count dd 0
117
	.Count dd 0
136
	.Buffer dd 0
118
	.Buffer dd 0
137
		db 0
119
		db 0
138
	.FileName dd file_name
120
	.FileName dd file_name
139
;---------------------------------------------------------------------
-
 
Line 140... Line 121...
140
 
121
 
141
@library_name     equ    dword [esp+16]
122
@library_name     equ    dword [esp+16]
142
@cur_dir_path     equ    dword [esp+12]
123
@cur_dir_path     equ    dword [esp+12]
143
@library_path     equ    dword [esp+8]
124
@library_path     equ    dword [esp+8]
Line -... Line 125...
-
 
125
@point_dir_name   equ    dword [esp+4]
-
 
126
 
-
 
127
;description:
-
 
128
; £®â®¢¨¬ ⥪áâ ¤«ï ¯®ª §  ç¥à¥§ @notify:
-
 
129
; 1) ¢ë¤¥«ï¥¬ ¯ ¬ïâì ¢ [arrea_xx] ­® ­¥ ¡®«ìè¥ ®¤­®£® à § 
-
 
130
; 2) ª®¯¨à㥬 § £®«®¢®ª (¥á«¨ ¥áâì ¨¬ï ä㭪樨 â® ¤®¡ ¢«ï¥¬ ¥£® ª § £®«®¢ªã) ¨ ⥪áâ á®®¡é¥­¨ï ¢ [arrea_xx]
-
 
131
;input:
-
 
132
; ebp+8 - head message
-
 
133
; ebp+12 - error message
-
 
134
; ebp+16 - 0 ¨«¨ ¨¬ï ä㭪樨, ª®â®àãî ­¥ 㤠«®áì íªá¯®àâ¨à®¢ âì
-
 
135
;output:
-
 
136
; eax = -1
-
 
137
align 4
-
 
138
l_lib_init_error_window:
-
 
139
	push ebp
-
 
140
	mov ebp,esp
-
 
141
	cmp dword[arrea_xx],0
-
 
142
	jne .no_msg ;¥á«¨ à ­ìè¥ ¡ë«® ᮧ¤ ­® ¤à㣮¥ á®®¡é¥­¨¥
-
 
143
	pushad
-
 
144
 
-
 
145
	mcall 68,11
-
 
146
	mcall 68,12,4096
-
 
147
	mov [arrea_xx],eax
-
 
148
 
-
 
149
	mov edi,eax
-
 
150
	mov esi,[ebp+8]
-
 
151
align 4
-
 
152
@@:
-
 
153
	movsb
-
 
154
	cmp byte[esi],0
-
 
155
	jne @b
-
 
156
	mov word[edi],0xa0d
-
 
157
	add edi,2
-
 
158
	
-
 
159
	;¤®¡ ¢«ï¥¬ ¨¬ï ä㭪樨 ¢ § £®«®¢®ª
-
 
160
	mov esi,[ebp+16]
-
 
161
	or esi,esi
-
 
162
	jz .lp1
-
 
163
	mov word[edi-2],0x2020
-
 
164
@@:
-
 
165
	movsb
-
 
166
	cmp byte[esi],0
-
 
167
	jne @b
-
 
168
	mov word[edi],0xa0d
-
 
169
	add edi,2
-
 
170
.lp1:
-
 
171
 
-
 
172
	mov esi,[ebp+12]
-
 
173
align 4
-
 
174
@@:
-
 
175
	movsb
-
 
176
	cmp byte[esi],0
-
 
177
	jne @b
-
 
178
	mov byte[edi],0
-
 
179
	popad
-
 
180
	.no_msg:
-
 
181
	or eax,-1
-
 
182
	pop ebp
144
@point_dir_name   equ    dword [esp+4]
183
	ret 12
145
 
184
 
146
align 4
185
align 4
147
@copy_path:
186
@copy_path:
148
	mov     esi,@cur_dir_path
187
	mov     esi,@cur_dir_path
Line 198... Line 237...
198
.lp4:
237
.lp4:
199
	lodsb
238
	lodsb
200
	stosb
239
	stosb
201
	test    eax,eax
240
	test    eax,eax
202
	jnz     .lp4
241
	jnz     .lp4
203
;---------------------------------------------------------------------
-
 
204
	ret
242
	ret
205
}
243
}
206
 
-
 
207
 
-
 
-
 
244
;---------------------------------------------------------------------
Line 208... Line 245...
208
 
245
 
209
macro @use_library_mem mem_alloc,mem_free,mem_realloc,dll_load
246
macro @use_library_mem mem_alloc,mem_free,mem_realloc,dll_load
210
{
247
{
211
@use_library
248
@use_library
212
library_fun_memory_alloc equ mem_alloc
249
library_fun_memory_alloc equ mem_alloc
213
library_fun_memory_free equ mem_free
250
library_fun_memory_free equ mem_free
214
library_fun_memory_realloc equ mem_realloc
251
library_fun_memory_realloc equ mem_realloc
215
library_fun_dll_load equ dll_load
252
library_fun_dll_load equ dll_load
Line 216... Line -...
216
}
-
 
217
 
253
}
218
 
254
 
219
macro sys_load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
255
macro sys_load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
220
{
256
{
221
local end_steep
-
 
222
local exit
257
local i_begin
Line 223... Line 258...
223
;---------------------------------------------------------------------  
258
local i_error
224
; loading Box_Lib library 
259
local i_exit
225
 
260
 
Line 226... Line 261...
226
        mcall   68,19,system_path__   ; load of sys directory
261
	mcall	68,19,system_path__   ; load of sys directory
227
        test    eax,eax
262
	test	eax,eax
228
        jnz     end_steep 
263
	jnz		i_begin
-
 
264
 
229
 
265
if point_dir_name__ eq
230
if point_dir_name__ eq
266
		copy_path   library_name__, cur_dir_path__, library_path__,0
231
  copy_path   library_name__, cur_dir_path__, library_path__,0x0
-
 
232
else
267
else
233
  copy_path   library_name__, cur_dir_path__, library_path__,point_dir_name__    ;the macros making way /current pach a program/+ name system library
268
		;the macros making way /current path a program/ + name system library
234
end if 
269
		copy_path   library_name__, cur_dir_path__, library_path__,point_dir_name__
-
 
270
end if
235
        
271
		mcall	68,19,library_path__ ; load of alternative
236
        mcall   68,19,library_path__ ; load of alternative
272
		test	eax,eax
237
        test    eax,eax
-
 
238
        jnz     end_steep
273
		jnz		i_begin
239
        show_error_window  err_message_found_lib__, head_f_l__    ;show error message /create window
274
		push	eax
240
        jmp     exit
275
		push	dword err_message_found_lib__
241
 
-
 
242
 
276
		push	dword head_f_l__	
243
align 4
-
 
244
end_steep:
277
		jmp		i_error
-
 
278
align 4
-
 
279
	i_begin:
-
 
280
		import_boxlib myimport
245
 
281
		test	eax,eax
246
        import_boxlib myimport, err_message_import__, head_f_i__  ;import
282
		jz		i_exit
-
 
283
		push	eax
247
exit:
284
		push	dword err_message_import__
248
        test    eax,eax
-
 
249
        jz      @f
285
		push	dword head_f_i__
250
 
-
 
251
        notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
-
 
252
        or      eax,-1
286
	i_error:
253
@@:     
-
 
-
 
287
		call	l_lib_init_error_window
Line 254... Line 288...
254
 
288
		notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
255
;---------------------------------------------------------------------
289
	i_exit:
256
}
290
}
257
 
291
;---------------------------------------------------------------------
258
 
-
 
259
macro load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
292
 
Line 260... Line 293...
260
{
293
macro load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
261
local end_steep
294
{
262
local exit
295
local i_begin
-
 
296
local i_error
263
;---------------------------------------------------------------------  
297
local i_exit
264
; loading Box_Lib library 
298
 
265
 
-
 
266
if point_dir_name__ eq
299
if point_dir_name__ eq
267
  copy_path   library_name__, cur_dir_path__, library_path__,0x0
300
		copy_path   library_name__, cur_dir_path__, library_path__,0
268
else
301
else
Line 269... Line 302...
269
  copy_path   library_name__, cur_dir_path__, library_path__,point_dir_name__    ;the macros making way /current pach a program/+ name system library
302
		;the macros making way /current path a program/ + name system library
270
end if 
303
		copy_path   library_name__, cur_dir_path__, library_path__,point_dir_name__
271
 
304
end if
272
        mcall   68,19,library_path__ ; load of alternative
305
		mcall	68,19,library_path__ ; load of alternative
273
        test    eax,eax
306
		test	eax,eax
274
        jnz     end_steep 
307
		jnz		i_begin 
275
        
308
 
276
        mcall   68,19,system_path__ ; load of sys directory
309
		mcall	68,19,system_path__ ; load of sys directory
277
        test    eax,eax
310
		test	eax,eax
278
        jnz     end_steep
-
 
279
 
311
		jnz		i_begin
280
        show_error_window  err_message_found_lib__, head_f_l__    ;show error message /create window
-
 
281
        jmp     exit
312
		push	eax
-
 
313
		push	dword err_message_found_lib__
-
 
314
		push	dword head_f_l__	
-
 
315
		jmp		i_error
282
 
316
align 4
283
align 4
317
	i_begin:
-
 
318
		import_boxlib myimport
284
end_steep:
319
		test	eax,eax
285
 
-
 
286
        import_boxlib myimport, err_message_import__, head_f_i__  ;import
320
		jz		i_exit
287
exit:
-
 
288
        test    eax,eax
321
		push	eax
289
        jz      @f
322
		push	dword err_message_found_lib__
-
 
323
		push	dword head_f_l__		
-
 
324
	i_error:
-
 
325
		call	l_lib_init_error_window
-
 
326
		notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
290
 
327
	i_exit:
291
        notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
328
;---------------------------------------------------------------------
292
        or      eax,-1
-
 
293
@@:     
329
}
294
        
-
 
295
;---------------------------------------------------------------------
330
 
-
 
331
;description:
-
 
332
; ¬ ªà®á § £à㧪¨ ¡¨¡«¨®â¥ª ¨§ á¨á⥬­®© ¯ ¯ª¨, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ­ ©¤¥­ 
-
 
333
; ⮣¤  ¯®¨áª ¨¤¥â ¢ ⥪ã饩 ¯ ¯ª¥ á ¯à®£à ¬¬®©
296
}
334
macro sys_load_libraries _start,_end
297
macro sys_load_libraries _start,_end
335
{
298
{
336
local cycle0
299
local exit_lp2
337
local end_steep
300
local lp2
338
local cycle0n
301
local lp
339
local cycle1
Line 314... Line 352...
314
point_dir_name__          equ [ebp+36]
352
point_dir_name__          equ [ebp+36]
315
adr_load_lib              equ dword [ebp+40]
353
adr_load_lib              equ dword [ebp+40]
316
status_lib                equ dword [ebp+44]
354
status_lib                equ dword [ebp+44]
Line 317... Line 355...
317
 
355
 
318
        mov     ebp,_start
356
	mov	ebp,_start
319
        mov     ecx,((_end-_start)/ll_struc_size)
-
 
320
 
357
	mov	ecx,(_end-_start)/ll_struc_size
-
 
358
align 4
321
align 4
359
	cycle0:
322
lp:     push    ecx
360
		push	ecx
323
        mcall   68,19,system_path__   ; load of sys directory
361
        mcall   68,19,system_path__   ; load of sys directory
324
        test    eax,eax
362
        test    eax,eax
Line 325... Line 363...
325
        jnz     end_steep 
363
        jnz     end_steep 
-
 
364
 
Line 326... Line 365...
326
 
365
        ;the macros making way /current path a program/ + name system library
327
        copy_path  library_name__, cur_dir_path__, library_path__,point_dir_name__     ;the macros making way /current pach a program/+ name system library
366
		copy_path  library_name__, cur_dir_path__, library_path__,point_dir_name__
328
        
367
        
-
 
368
        mcall   68,19,library_path__ ; load of alternative
Line -... Line 369...
-
 
369
        test    eax,eax
329
        mcall   68,19,library_path__ ; load of alternative
370
        jnz     end_steep
330
        test    eax,eax
-
 
-
 
371
        or      status_lib,1          ; status of code - enable error - not found library
331
        jnz     end_steep
372
 
332
 
373
		push	eax
Line 333... Line 374...
333
        or      status_lib,0x1          ; status of code - enable error - not found library
374
		push	dword err_message_found_lib__
334
 
375
		push	dword head_f_l__
335
        show_error_window  err_message_found_lib__, head_f_l__,    ;show error message /create window
376
		call	l_lib_init_error_window
336
        jmp      next
377
        jmp		cycle0n
337
 
-
 
338
align 4
378
 
339
end_steep:
379
align 4
340
        mov     adr_load_lib,eax        ;save adr lib in memory
-
 
341
        import_boxlib my_import, err_message_import__, head_f_i__  ;import
380
	end_steep:
342
 
381
		mov		adr_load_lib,eax        ;save adr lib in memory
-
 
382
		import_boxlib my_import
-
 
383
		test	eax,eax
-
 
384
		jz		cycle0n
343
        test    eax,eax
385
		or		status_lib,2          ; status of code - enable error - import error
344
        jz      next
386
		push	eax
345
 
387
		push	dword err_message_import__
346
        or      status_lib,0x2          ; status of code - enable error - import error
388
		push	dword head_f_i__		
347
 
389
		call	l_lib_init_error_window
Line 348... Line 390...
348
next:
390
	cycle0n:
349
        pop     ecx
391
		pop     ecx
350
        add     ebp,ll_struc_size
392
		add     ebp,ll_struc_size
351
        dec     ecx
-
 
352
        jnz     lp
393
		dec     ecx
353
 
394
		jnz     cycle0
354
;----------------------------------
395
 
355
        mov     ebp,_start
396
	;¢ë¢®¤ á®®¡é¥­¨ï ®¡ ®è¨¡ª¥ ¯à¨ § £à㧪¥
356
        mov     ecx,((_end-_start)/ll_struc_size)
397
	mov     ebp,_start
357
 
-
 
358
align 4
398
	mov     ecx,(_end-_start)/ll_struc_size
359
lp2:
399
align 4
360
        mov     eax,status_lib
400
	cycle1:
361
        test    eax,eax
401
		mov     eax,status_lib
362
        jz      @f
402
		test    eax,eax
363
 
403
		jz      cycle1n
364
        notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
404
		notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
365
        or      eax,-1
405
		mov		eax,-1
366
        jmp     exit_lp2
406
		jmp		cycle1e
367
 
407
align 4
Line -... Line 408...
-
 
408
		cycle1n:
-
 
409
		add     ebp,ll_struc_size
-
 
410
		dec     ecx
368
@@:
411
		jnz     cycle1
369
        add     ebp,ll_struc_size
412
	cycle1e:
370
        dec     ecx
413
}
371
        jnz     lp2
-
 
372
exit_lp2:
-
 
373
}
414
 
-
 
415
;description:
-
 
416
; ¬ ªà®á § £à㧪¨ ¡¨¡«¨®â¥ª ¨§ ⥪ã饩 ¯ ¯ª¨ á ¯à®£à ¬¬®©, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ­ ©¤¥­ 
-
 
417
; ⮣¤  ¯®¨áª ¨¤¥â ¢ á¨á⥬­®© ¯ ¯ª¥
374
 
418
macro load_libraries _start,_end
375
macro load_libraries _start,_end
419
{
376
{
420
local cycle0
377
local lp2
421
local end_steep
378
local exit_lp2
422
local cycle0n
379
local lp
423
local cycle1
Line 392... Line 436...
392
point_dir_name__          equ [ebp+36]
436
point_dir_name__          equ [ebp+36]
393
adr_load_lib              equ dword [ebp+40]
437
adr_load_lib              equ dword [ebp+40]
394
status_lib                equ dword [ebp+44]
438
status_lib                equ dword [ebp+44]
Line 395... Line 439...
395
 
439
 
396
        mov     ebp,_start
440
	mov	ebp,_start
397
        mov     ecx,((_end-_start)/ll_struc_size)
-
 
398
 
441
	mov	ecx,(_end-_start)/ll_struc_size
-
 
442
align 4
399
align 4
443
	cycle0:
Line -... Line 444...
-
 
444
		push	ecx
400
lp:     push    ecx
445
 
Line 401... Line 446...
401
 
446
		;the macros making way /current path a program/ + name system library
402
        copy_path    library_name__, cur_dir_path__, library_path__,point_dir_name__   ;the macros making way /current pach a program/+ name system library
447
		copy_path    library_name__, cur_dir_path__, library_path__,point_dir_name__
403
 
448
 
Line 404... Line 449...
404
        mcall   68,19,library_path__  ; load of alternative
449
		mcall	68,19,library_path__  ; load of alternative
405
        test    eax,eax
450
		test	eax,eax
406
        jnz     end_steep 
451
		jnz		end_steep
-
 
452
 
Line -... Line 453...
-
 
453
		mcall	68,19,system_path__   ; load of sys directory
407
        
454
		test	eax,eax
408
        mcall   68,19,system_path__   ; load of sys directory
-
 
-
 
455
		jnz		end_steep
409
        test    eax,eax
456
		or		status_lib,1          ; status of code - enable error - not found library
410
        jnz     end_steep
457
 
Line 411... Line 458...
411
 
458
		push	eax
412
        or      status_lib,0x1          ; status of code - enable error - not found library
459
		push	dword err_message_found_lib__
413
 
460
		push	dword head_f_l__
414
        show_error_window  err_message_found_lib__, head_f_l__    ;show error message /create window
-
 
415
        jmp      next
461
		call	l_lib_init_error_window
416
 
-
 
417
align 4
462
		jmp		cycle0n
418
end_steep:
463
 
419
        mov     adr_load_lib,eax        ;save adr lib in memory
-
 
420
 
464
align 4
421
        import_boxlib my_import, err_message_import__, head_f_i__  ;import
465
	end_steep:
-
 
466
		mov		adr_load_lib,eax        ;save adr lib in memory
-
 
467
		import_boxlib my_import
-
 
468
		test	eax,eax
422
 
469
		jz		cycle0n
423
        test    eax,eax
470
		or		status_lib,2          ; status of code - enable error - import error
424
        jz      next
471
		push	eax
425
 
472
		push	dword err_message_import__
426
        or      status_lib,0x2          ; status of code - enable error - import error
473
		push	dword head_f_i__		
Line 427... Line 474...
427
 
474
		call	l_lib_init_error_window
428
next:
475
	cycle0n:
429
        pop     ecx
476
		pop     ecx
430
        add     ebp,ll_struc_size
-
 
431
        dec     ecx
477
		add     ebp,ll_struc_size
432
        jnz     lp
478
		dec     ecx
433
 
479
		jnz     cycle0
434
;-----------------------------------------------
480
 
435
        mov     ebp,_start
481
	;¢ë¢®¤ á®®¡é¥­¨ï ®¡ ®è¨¡ª¥ ¯à¨ § £à㧪¥
436
        mov     ecx,((_end-_start)/ll_struc_size)
-
 
437
 
482
	mov     ebp,_start
438
align 4
483
	mov     ecx,(_end-_start)/ll_struc_size
439
lp2:
484
align 4
440
        mov     eax,status_lib
485
	cycle1:
441
        test    eax,eax
486
		mov     eax,status_lib
442
        jz      @f
487
		test    eax,eax
443
 
488
		jz      cycle1n
444
        notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
489
		notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
445
        or      eax,-1
490
		mov		eax,-1
446
        jmp     exit_lp2
-
 
447
 
491
		jmp		cycle1e
Line 448... Line 492...
448
@@:
492
align 4
449
        add     ebp,ll_struc_size
493
		cycle1n:
Line 466... Line 510...
466
	add  esp,16
510
	add  esp,16
467
	;notify_window_run lib_path ;unblok for test load path
511
	;notify_window_run lib_path ;unblok for test load path
468
popad   ;restore all registers
512
popad   ;restore all registers
469
}
513
}
Line 470... Line -...
470
 
-
 
471
; £®â®¢¨¬ ⥪áâ ¤«ï ¯®ª §  ç¥à¥§ @notify:
-
 
472
; 1) ¢ë¤¥«ï¥¬ ¯ ¬ïâì ¢ [arrea_xx]
-
 
473
; 2) ª®¯¨à㥬 err_message ¨ head ¢ [arrea_xx]
-
 
474
macro show_error_window  err_message, head
-
 
475
{
-
 
476
local lp0
-
 
477
local lp1
-
 
478
 
-
 
479
pushad
-
 
480
	mcall 68,11
-
 
481
	mcall 68,12,4096
-
 
482
	push eax
-
 
483
	pop dword[arrea_xx]
-
 
484
 
-
 
485
	mov edi,eax
-
 
486
	mov esi,head
-
 
487
	cld
-
 
488
align 4
-
 
489
lp0:
-
 
490
	movsb
-
 
491
	cmp byte[esi],0
-
 
492
	jne lp0
-
 
493
	mov word[edi],0xa0d
-
 
494
	add edi,2
-
 
495
	mov esi,dword err_message
-
 
496
align 4
-
 
497
lp1:
-
 
498
	movsb
-
 
499
	cmp byte[esi],0
-
 
500
	jne lp1
-
 
501
	mov byte[edi],0
-
 
502
popad
-
 
503
	or eax,-1  ;ã¢ë
-
 
504
}
-
 
505
 
514
 
506
; ¢ª«îç ¥¬ ¯®ª § á®®¡é¥­¨ï ç¥à¥§ @notify:
515
; ¢ª«îç ¥¬ ¯®ª § á®®¡é¥­¨ï ç¥à¥§ @notify:
507
macro notify_window_run message
516
macro notify_window_run message
508
{
517
{
509
push eax ebx
518
push eax ebx
Line 514... Line 523...
514
	int 0x40
523
	int 0x40
515
pop ebx eax
524
pop ebx eax
516
}
525
}
Line 517... Line 526...
517
 
526
 
518
 
527
 
519
;¢å®¤­ë¥ ¯ à ¬¥âàë:
528
;input:
-
 
529
; eax -  ¤à¥á ¡¨¡«¨®â¥ª¨ ¢ ¯ ¬ïâ¨
-
 
530
; myimport - ¨¬¯®àâ¨àã¥¬ë¥ ä㭪樨
520
;eax -  ¤à¥á ¡¨¡«¨®â¥ª¨ ¢ ¯ ¬ïâ¨
531
;output:
521
;myimport - ¨¬¯®àâ¨àã¥¬ë¥ ä㭪樨
532
; eax - ¥á«¨ 㤠筮 â® 0 ¨«¨ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 ª®â®àãî ­¥ 㤠«®áì § £à㧨âì
522
macro import_boxlib myimport, err_message_import__, head_f_i__
533
macro import_boxlib myimport
523
{
534
{
524
local import_loop
535
local import_loop
525
local import_find
536
local import_find
526
local lp
537
local lp
527
local import_find_next
538
local import_find_next
528
local import_found
539
local import_found
529
local import_done
-
 
530
local exit
540
local import_done
531
local e.exit
541
local exit
Line 532... Line 542...
532
local import_not_found
542
local import_not_found
533
; initialize import
543
; initialize import
Line 538... Line 548...
538
        lodsd	;mov eax,dword[esi] ;add esi,4 ;¯®«ãç ¥¬ ¢ eax 㪠§ â¥«ì ­  ¨¬ï ¨¬¯®àâ¨à㥬®© ä㭪樨
548
        lodsd	;mov eax,dword[esi] ;add esi,4 ;¯®«ãç ¥¬ ¢ eax 㪠§ â¥«ì ­  ¨¬ï ¨¬¯®àâ¨à㥬®© ä㭪樨
539
        test    eax, eax
549
        test    eax, eax
540
        jz      import_done ;¥á«¨ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 = 0 (¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥)
550
        jz      import_done ;¥á«¨ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 = 0 (¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥)
541
        push    edx ;á®å࠭塞 ­ ç «® ¡¨¡«¨®â¥ç­ëå 㪠§ â¥«¥© ­  ä㭪樨
551
        push    edx ;á®å࠭塞 ­ ç «® ¡¨¡«¨®â¥ç­ëå 㪠§ â¥«¥© ­  ä㭪樨
542
import_find:
552
import_find:
543
        mov     ebx, [ds:edx]
553
        mov     ebx, [edx]
544
        test    ebx, ebx
554
        test    ebx, ebx
545
        jz      import_not_found ;¥á«¨ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 = 0 (¢ ¡¨¡«¨®â¥ª¥)
555
        jz      import_not_found ;¥á«¨ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 = 0 (¢ ¡¨¡«¨®â¥ª¥)
546
        push    eax ;eax - 㪠§ â¥«ì ­  ¨¬ï íªá¯®àâ¨à㥬®© ä㭪樨 (¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥)
556
        push    eax ;eax - 㪠§ â¥«ì ­  ¨¬ï íªá¯®àâ¨à㥬®© ä㭪樨 (¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥)
547
lp:
557
lp:
548
        mov     cl, [ds:eax]
558
        mov     cl, [eax]
549
        cmp     cl, [ds:ebx] ;áà ¢­¨¢ ¥¬ ¨¬¥­  ä㭪権 ¢ ¡¨¡«¨®â¥ª¥ ¨ ¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥
559
        cmp     cl, [ebx] ;áà ¢­¨¢ ¥¬ ¨¬¥­  ä㭪権 ¢ ¡¨¡«¨®â¥ª¥ ¨ ¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥
550
        jnz     import_find_next ;¥á«¨ ­ §¢ ­¨ï ­¥ ᮢ¯ «¨
560
        jnz     import_find_next ;¥á«¨ ­ §¢ ­¨ï ­¥ ᮢ¯ «¨
551
        test    cl, cl
561
        test    cl, cl
552
        jz      import_found ;¥á«¨ ­ §¢ ­¨ï ᮢ¯ «¨, ¨ 㦥 ª®­¥æ áâப¨ (cl=0)
562
        jz      import_found ;¥á«¨ ­ §¢ ­¨ï ᮢ¯ «¨, ¨ 㦥 ª®­¥æ áâப¨ (cl=0)
553
        inc     eax
563
        inc     eax
554
        inc     ebx
564
        inc     ebx
Line 557... Line 567...
557
        pop     eax
567
        pop     eax
558
        add     edx, 8 ;8 = 4 ¡ ©â  㪠§ â¥«ì ­  ­ §¢ ­¨¥ ¨ 4 ¡ ©â  㪠§ â¥«ì ­  äã­ªæ¨î
568
        add     edx, 8 ;8 = 4 ¡ ©â  㪠§ â¥«ì ­  ­ §¢ ­¨¥ ¨ 4 ¡ ©â  㪠§ â¥«ì ­  äã­ªæ¨î
559
        jmp     import_find
569
        jmp     import_find
560
import_found:
570
import_found:
561
        pop     ebx ;¢®áâ ­ ¢«¨¢ ¥¬ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 (ª®â®àë© ¡ë« ¢ eax) ¨ ®á¢®¡®¦¤ ¥¬ á⥪
571
        pop     ebx ;¢®áâ ­ ¢«¨¢ ¥¬ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 (ª®â®àë© ¡ë« ¢ eax) ¨ ®á¢®¡®¦¤ ¥¬ á⥪
562
        mov     eax, [ds:edx+4] ;eax = 㪠§ â¥«ì ­  äã­ªæ¨î (¢ ¡¨¡«¨®â¥ª¥)
572
        mov     eax, [edx+4] ;eax = 㪠§ â¥«ì ­  äã­ªæ¨î (¢ ¡¨¡«¨®â¥ª¥)
563
        mov     [esi-4], eax ;ª®¯¨à㥬 㪠§ â¥«ì (­  äã­ªæ¨î) ¢ ¯à®£à ¬¬ã, -4 áâ ¢¨¬ ¯®â®¬ã çâ® esi ¡ë«® ᤢ¨­ãâ® ª®¬ ­¤®© lodsd
573
        mov     [esi-4], eax ;ª®¯¨à㥬 㪠§ â¥«ì (­  äã­ªæ¨î) ¢ ¯à®£à ¬¬ã, -4 áâ ¢¨¬ ¯®â®¬ã çâ® esi ¡ë«® ᤢ¨­ãâ® ª®¬ ­¤®© lodsd
564
        pop     edx ;ãáâ ­ ¢«¨¢ ¥¬ edx ­  ­ ç «® ¡¨¡«¨®â¥ç­ëå ä㭪権
574
        pop     edx ;ãáâ ­ ¢«¨¢ ¥¬ edx ­  ­ ç «® ¡¨¡«¨®â¥ç­ëå ä㭪権
565
;--- ¯à®¢¥à塞 ᮢ¯ ¤ ¥â «¨ ¨¬ï íªá¯®àâ¨à®¢ ­­®© ä㭪樨 á 'lib_init'
575
;--- ¯à®¢¥à塞 ᮢ¯ ¤ ¥â «¨ ¨¬ï íªá¯®àâ¨à®¢ ­­®© ä㭪樨 á 'lib_init'
566
if library_fun_memory_alloc eq 0
576
if library_fun_memory_alloc eq 0
567
else
577
else
Line 583... Line 593...
583
		popad
593
		popad
584
end if
594
end if
585
        jmp     import_loop
595
        jmp     import_loop
586
import_not_found:
596
import_not_found:
587
        add     esp,4
597
        add     esp,4
588
        show_error_window  err_message_import__, head_f_i__    ;show error message /create window
-
 
589
        jmp     e.exit
598
        jmp     exit
590
import_done:
599
import_done:
591
        xor     eax,eax ;=0 ¢á¥ § £à㧨«®áì 㤠筮
600
        xor     eax,eax ;=0 ¢á¥ § £à㧨«®áì 㤠筮
592
e.exit: 
601
exit:
593
;---------------------------------------------------------------------
-
 
594
}
602
} 
-
 
603
;---------------------------------------------------------------------
-
 
604
 
595
ll_struc_size = 48;($-library_name__)    ; constant   size of struct
605
ll_struc_size = 48;($-library_name__)    ; constant   size of struct
596
struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, my_import, err_message_import__, head_f_i__,point_dir_name; struct for loading libraries
606
struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, my_import, err_message_import__, head_f_i__,point_dir_name; struct for loading libraries
597
{        
607
{        
598
.library_name__           dd library_name__        ; ¨¬ï § £à㦠¥¬®© ¡¨¡«¨®â¥ª¨
608
.library_name__           dd library_name__        ; ¨¬ï § £à㦠¥¬®© ¡¨¡«¨®â¥ª¨
599
.cur_dir_path__           dd cur_dir_path__        ; 㪠§ â¥«ì ­  ¡ãä¥à ¢ ª®â®à®¬ ᮤ¥à¦¨âìáï ¯ãâì ®â ªã¤  ¡ë«  § ¯ã饭  ¯à®£à ¬¬ 
609
.cur_dir_path__           dd cur_dir_path__        ; 㪠§ â¥«ì ­  ¡ãä¥à ¢ ª®â®à®¬ ᮤ¥à¦¨âìáï ¯ãâì ®â ªã¤  ¡ë«  § ¯ã饭  ¯à®£à ¬¬ 
Line 605... Line 615...
605
.head_f_l__               dd head_f_l__
615
.head_f_l__               dd head_f_l__
606
.my_import                dd my_import
616
.my_import                dd my_import
607
.err_message_import__     dd err_message_import__
617
.err_message_import__     dd err_message_import__
608
.head_f_i__               dd head_f_i__
618
.head_f_i__               dd head_f_i__
609
if point_dir_name eq
619
if point_dir_name eq
610
.point_dir_name__	dd 0x0
620
.point_dir_name__	dd 0
611
else
621
else
612
.point_dir_name__	dd point_dir_name	   ; ¨¬ï ¢«®¦¥­­®© ¤¨à४â®à¨¨ ¢ ªâ®à®© åà ­ïâìáï ¯®¤£à㦠¥¬ë¥ ¬®¤ã«¨.
622
.point_dir_name__	dd point_dir_name	   ; ¨¬ï ¢«®¦¥­­®© ¤¨à४â®à¨¨ ¢ ªâ®à®© åà ­ïâìáï ¯®¤£à㦠¥¬ë¥ ¬®¤ã«¨.
613
end if 
623
end if 
614
.adr_load_lib           dd 0x0
624
.adr_load_lib           dd 0
615
.status_lib             dd 0x0          ;status of load library
625
.status_lib             dd 0          ;status of load library
616
;
626
;
617
}
627
}