Subversion Repositories Kolibri OS

Rev

Rev 5881 | Rev 8083 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3374 IgorA 1
;13.03.2013 - use @notify
2
;08.06.2010 - new macros @use_library_mem
3
;08.05.2009 - bugfix
1108 Lrz 4
;14.04.2009 - a macros for code load library the box_lib.obj from '/sys/lib/' or current dirrectory.
5
; The macros for load any library/libraries:
6
; Copyright (c) 2009, 
7
; All rights reserved.
8
;
9
; Redistribution and use in source and binary forms, with or without
10
; modification, are permitted provided that the following conditions are met:
11
;       * Redistributions of source code must retain the above copyright
12
;       notice, this list of conditions and the following disclaimer.
13
;       * Redistributions in binary form must reproduce the above copyright
14
;       notice, this list of conditions and the following disclaimer in the
15
;       documentation and/or other materials provided with the distribution.
16
;       * Neither the name of the  nor the
17
;       names of its contributors may be used to endorse or promote products
18
;       derived from this software without specific prior written permission.
19
;
20
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka  ''AS IS'' AND ANY
21
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
; DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
24
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
;*****************************************************************************
31
; This macros based on source code:
3374 IgorA 32
;  - Alexey Teplov / Алексей Теплов
33
; Mario79, Mario - Marat Zakiyanov / Марат Закиянов
34
; Diamondz - Evgeny Grechnikov / Евгений Гречников
1108 Lrz 35
;------------------------
36
; DESCRIPTION
37
; Macro load_library
38
; Logick of work.
39
; A first time we must to check system path, where I belive find a system library. System path is "/sys/lib/".
40
; If I cannot found my library, i must to check second way. Second way is current dirrectory.
41
; If we cannot load library, we must show the error message:
42
; "I'm sorry,the programm cannot found system library box_lib.obj."
43
; "The find was make on 2 ways: /sys/lib/ and current dirrectory."
44
;
45
;
46
;---------------------------------------------------------------------
47
; Macro sys_load_library
48
; A first time we must to check own path in current dirrectory the program, where I belive find a system library.
49
; If I cannot found my library, i must to check second way. Second way is system path a "/sys/lib/".
50
; If we cannot load library, we must show the error message:
51
; "I'm sorry,the programm cannot found system library box_lib.obj."
52
; "The find was make on 2 ways: /sys/lib/ and current dirrectory."
53
;
54
;---------------------------------------------------------------------
55
; How can I use it?
56
;---------------------------------------------------------------------
57
;-Example using single load library
58
;-universal load library/librarys
1127 Lrz 59
;load_library  library_name__, cur_dir_path__, library_path__, system_path__, \
60
;err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__
1108 Lrz 61
;-if return code =-1 then exit, else normally work
62
;        cmp     eax,-1
63
;        jz      exit
64
;- Well, if you get
65
;
66
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
3374 IgorA 67
;DATA данные
68
;Всегда соблюдать последовательность в имени.
1127 Lrz 69
;system_path__      db '/sys/lib/'
70
;library_name__     db 'box_lib.obj',0
3374 IgorA 71
; Если есть желание разъединить, то нужно использовать следующию конструкцию
1127 Lrz 72
;system_path__      db '/sys/lib/box_lib.obj',0
3374 IgorA 73
;... любая последовательность других команд и определений.
1127 Lrz 74
;library_name__     db 'box_lib.obj',0
1108 Lrz 75
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
76
 
1127 Lrz 77
;err_message_found_lib__   db 'Sorry I cannot found library box_lib.obj',0
78
;head_f_i__:
79
;head_f_l__        db 'System error',0
80
;err_message_import__      db 'Error on load import library box_lib.obj',0
1108 Lrz 81
 
82
;myimport:
83
;
84
;edit_box_draw   dd      aEdit_box_draw
85
;edit_box_key    dd      aEdit_box_key
86
;edit_box_mouse  dd      aEdit_box_mouse
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
98
;                dd      0
99
;
100
;aEdit_box_draw  db 'edit_box',0
101
;aEdit_box_key   db 'edit_box_key',0
102
;aEdit_box_mouse db 'edit_box_mouse',0
103
;aVersion_ed     db 'version_ed',0
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
111
;aVersion_op       db 'version_op',0
112
 
113
;---------------------------------------------------------------------
114
macro @use_library
115
{
1127 Lrz 116
local lp1
4987 IgorA 117
local lp2
118
local lp3
119
local lp4
6245 IgorA 120
local lp5
121
local lp6
3374 IgorA 122
local file_name
1488 IgorA 123
 
3374 IgorA 124
library_fun_memory_alloc equ 0 ;не использовать в макросах проверку на функции 'lib_init'
1108 Lrz 125
 
126
align 4
3374 IgorA 127
arrea_xx dd 0
128
file_name db '/rd/1/@notify',0
1127 Lrz 129
 
130
align 4
3374 IgorA 131
run_notify_struct:
132
	.Function dd 7
133
	.Position dd 0
134
	.Flags dd ?
135
	.Count dd 0
136
	.Buffer dd 0
137
		db 0
138
	.FileName dd file_name
1108 Lrz 139
;---------------------------------------------------------------------
140
 
1204 Lrz 141
@library_name     equ    dword [esp+16]
142
@cur_dir_path     equ    dword [esp+12]
143
@library_path     equ    dword [esp+8]
144
@point_dir_name   equ    dword [esp+4]
145
 
1108 Lrz 146
align 4
147
@copy_path:
5881 IgorA 148
	mov     esi,@cur_dir_path
149
	mov     edi,@library_path
150
	xor     eax,eax
151
	cld
1204 Lrz 152
align 4
1108 Lrz 153
.lp1:
5881 IgorA 154
	lodsb
155
	stosb
156
	test    eax,eax
157
	jnz     .lp1
158
	mov     esi,edi
159
	dec     esi ;переход на символ конца строки @cur_dir_path
160
	std
1204 Lrz 161
align 4
1108 Lrz 162
.lp2:
5881 IgorA 163
	lodsb
164
	cmp     al,'/'
165
	jnz     .lp2
166
	mov     edi,esi
167
	add     edi,2
168
	cld
169
	mov     esi,@point_dir_name
170
	test    esi,esi
1204 Lrz 171
	jz      .str_lp4
1108 Lrz 172
 
6245 IgorA 173
	;проверка относительных путей c двумя точками '../'
174
	cmp word[esi],'..'
175
	jne .lp3
176
	dec edi ;для перехода на '/'
177
.lp6:
178
		add esi,3 ;пропускаем одно поднятие '../'
179
.lp5:
180
		dec edi ;идем по папкам
181
		cmp byte[edi],'/'
182
		jnz .lp5
183
	cmp word[esi],'..'
184
	je .lp6
185
	inc edi ;для перехода на '/'
186
 
187
	;копирование относительного пути
1204 Lrz 188
align 4
1108 Lrz 189
.lp3:
5881 IgorA 190
	lodsb
191
	stosb
192
	test    eax,eax
193
	jnz     .lp3
194
	dec     edi
1204 Lrz 195
.str_lp4:
196
	mov     esi,@library_name
197
align 4
198
.lp4:
5881 IgorA 199
	lodsb
200
	stosb
201
	test    eax,eax
202
	jnz     .lp4
6245 IgorA 203
;---------------------------------------------------------------------
5881 IgorA 204
	ret
1108 Lrz 205
}
206
 
207
 
208
 
1488 IgorA 209
macro @use_library_mem mem_alloc,mem_free,mem_realloc,dll_load
210
{
211
@use_library
212
library_fun_memory_alloc equ mem_alloc
213
library_fun_memory_free equ mem_free
214
library_fun_memory_realloc equ mem_realloc
215
library_fun_dll_load equ dll_load
216
}
217
 
218
 
1204 Lrz 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__
1108 Lrz 220
{
221
local end_steep
222
local exit
223
;---------------------------------------------------------------------
224
; loading Box_Lib library
225
 
1127 Lrz 226
        mcall   68,19,system_path__   ; load of sys directory
1108 Lrz 227
        test    eax,eax
228
        jnz     end_steep
229
 
1204 Lrz 230
if point_dir_name__ eq
231
  copy_path   library_name__, cur_dir_path__, library_path__,0x0
232
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
234
end if
1108 Lrz 235
 
1127 Lrz 236
        mcall   68,19,library_path__ ; load of alternative
1108 Lrz 237
        test    eax,eax
238
        jnz     end_steep
1127 Lrz 239
        show_error_window  err_message_found_lib__, head_f_l__    ;show error message /create window
1108 Lrz 240
        jmp     exit
241
 
242
 
243
align 4
244
end_steep:
245
 
1127 Lrz 246
        import_boxlib myimport, err_message_import__, head_f_i__  ;import
1108 Lrz 247
exit:
1127 Lrz 248
        test    eax,eax
249
        jz      @f
250
 
3374 IgorA 251
        notify_window_run [arrea_xx] ; создаем окно @notify
1127 Lrz 252
        or      eax,-1
253
@@:
254
 
1108 Lrz 255
;---------------------------------------------------------------------
256
}
257
 
258
 
1204 Lrz 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__
1108 Lrz 260
{
261
local end_steep
262
local exit
263
;---------------------------------------------------------------------
264
; loading Box_Lib library
265
 
1204 Lrz 266
if point_dir_name__ eq
267
  copy_path   library_name__, cur_dir_path__, library_path__,0x0
268
else
269
  copy_path   library_name__, cur_dir_path__, library_path__,point_dir_name__    ;the macros making way /current pach a program/+ name system library
270
end if
1108 Lrz 271
 
1127 Lrz 272
        mcall   68,19,library_path__ ; load of alternative
1108 Lrz 273
        test    eax,eax
274
        jnz     end_steep
275
 
1127 Lrz 276
        mcall   68,19,system_path__ ; load of sys directory
1108 Lrz 277
        test    eax,eax
278
        jnz     end_steep
279
 
1127 Lrz 280
        show_error_window  err_message_found_lib__, head_f_l__    ;show error message /create window
1108 Lrz 281
        jmp     exit
282
 
283
align 4
284
end_steep:
285
 
1127 Lrz 286
        import_boxlib myimport, err_message_import__, head_f_i__  ;import
1108 Lrz 287
exit:
1127 Lrz 288
        test    eax,eax
289
        jz      @f
290
 
3374 IgorA 291
        notify_window_run [arrea_xx] ; создаем окно @notify
1127 Lrz 292
        or      eax,-1
293
@@:
294
 
1108 Lrz 295
;---------------------------------------------------------------------
296
}
297
macro sys_load_libraries _start,_end
298
{
1127 Lrz 299
local exit_lp2
300
local lp2
1108 Lrz 301
local lp
302
local end_steep
303
local next
304
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1127 Lrz 305
library_name__            equ [ebp]
306
cur_dir_path__            equ [ebp+4]
307
library_path__            equ [ebp+8]
308
system_path__             equ [ebp+12]
309
err_message_found_lib__   equ [ebp+16]
310
head_f_l__                equ [ebp+20]
1204 Lrz 311
my_import                 equ [ebp+24]
1127 Lrz 312
err_message_import__      equ [ebp+28]
313
head_f_i__                equ [ebp+32]
1204 Lrz 314
point_dir_name__          equ [ebp+36]
315
adr_load_lib              equ dword [ebp+40]
316
status_lib                equ dword [ebp+44]
1108 Lrz 317
 
318
        mov     ebp,_start
319
        mov     ecx,((_end-_start)/ll_struc_size)
320
 
321
align 4
322
lp:     push    ecx
1127 Lrz 323
        mcall   68,19,system_path__   ; load of sys directory
1108 Lrz 324
        test    eax,eax
325
        jnz     end_steep
326
 
1204 Lrz 327
        copy_path  library_name__, cur_dir_path__, library_path__,point_dir_name__     ;the macros making way /current pach a program/+ name system library
1108 Lrz 328
 
1127 Lrz 329
        mcall   68,19,library_path__ ; load of alternative
1108 Lrz 330
        test    eax,eax
331
        jnz     end_steep
332
 
333
        or      status_lib,0x1          ; status of code - enable error - not found library
334
 
1204 Lrz 335
        show_error_window  err_message_found_lib__, head_f_l__,    ;show error message /create window
1108 Lrz 336
        jmp      next
337
 
338
align 4
339
end_steep:
340
        mov     adr_load_lib,eax        ;save adr lib in memory
1127 Lrz 341
        import_boxlib my_import, err_message_import__, head_f_i__  ;import
1108 Lrz 342
 
343
        test    eax,eax
344
        jz      next
345
 
346
        or      status_lib,0x2          ; status of code - enable error - import error
347
 
348
next:
349
        pop     ecx
350
        add     ebp,ll_struc_size
351
        dec     ecx
352
        jnz     lp
1127 Lrz 353
 
354
;----------------------------------
355
        mov     ebp,_start
356
        mov     ecx,((_end-_start)/ll_struc_size)
357
 
358
align 4
359
lp2:
360
        mov     eax,status_lib
361
        test    eax,eax
362
        jz      @f
363
 
3374 IgorA 364
        notify_window_run [arrea_xx] ; создаем окно @notify
1127 Lrz 365
        or      eax,-1
366
        jmp     exit_lp2
367
 
368
@@:
369
        add     ebp,ll_struc_size
370
        dec     ecx
371
        jnz     lp2
372
exit_lp2:
1108 Lrz 373
}
374
 
375
macro load_libraries _start,_end
376
{
1127 Lrz 377
local lp2
378
local exit_lp2
1108 Lrz 379
local lp
380
local end_steep
381
local next
382
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1127 Lrz 383
library_name__            equ [ebp]
384
cur_dir_path__            equ [ebp+4]
385
library_path__            equ [ebp+8]
386
system_path__             equ [ebp+12]
387
err_message_found_lib__   equ [ebp+16]
388
head_f_l__                equ [ebp+20]
1204 Lrz 389
my_import                 equ [ebp+24]
1127 Lrz 390
err_message_import__      equ [ebp+28]
391
head_f_i__                equ [ebp+32]
1204 Lrz 392
point_dir_name__          equ [ebp+36]
393
adr_load_lib              equ dword [ebp+40]
394
status_lib                equ dword [ebp+44]
1108 Lrz 395
 
396
        mov     ebp,_start
397
        mov     ecx,((_end-_start)/ll_struc_size)
398
 
399
align 4
400
lp:     push    ecx
401
 
1204 Lrz 402
        copy_path    library_name__, cur_dir_path__, library_path__,point_dir_name__   ;the macros making way /current pach a program/+ name system library
1108 Lrz 403
 
1127 Lrz 404
        mcall   68,19,library_path__  ; load of alternative
1108 Lrz 405
        test    eax,eax
406
        jnz     end_steep
407
 
1127 Lrz 408
        mcall   68,19,system_path__   ; load of sys directory
1108 Lrz 409
        test    eax,eax
410
        jnz     end_steep
411
 
412
        or      status_lib,0x1          ; status of code - enable error - not found library
413
 
1127 Lrz 414
        show_error_window  err_message_found_lib__, head_f_l__    ;show error message /create window
1108 Lrz 415
        jmp      next
416
 
417
align 4
418
end_steep:
419
        mov     adr_load_lib,eax        ;save adr lib in memory
420
 
1127 Lrz 421
        import_boxlib my_import, err_message_import__, head_f_i__  ;import
1108 Lrz 422
 
423
        test    eax,eax
424
        jz      next
425
 
426
        or      status_lib,0x2          ; status of code - enable error - import error
427
 
428
next:
429
        pop     ecx
430
        add     ebp,ll_struc_size
431
        dec     ecx
432
        jnz     lp
1127 Lrz 433
 
434
;-----------------------------------------------
435
        mov     ebp,_start
436
        mov     ecx,((_end-_start)/ll_struc_size)
437
 
438
align 4
439
lp2:
440
        mov     eax,status_lib
441
        test    eax,eax
442
        jz      @f
443
 
3374 IgorA 444
        notify_window_run [arrea_xx] ; создаем окно @notify
1127 Lrz 445
        or      eax,-1
446
        jmp     exit_lp2
447
 
448
@@:
449
        add     ebp,ll_struc_size
450
        dec     ecx
451
        jnz     lp2
452
exit_lp2:
453
 
1108 Lrz 454
}
455
 
456
 
1204 Lrz 457
macro copy_path lib_name,dir_path,lib_path,point_dir_name
1108 Lrz 458
{
6245 IgorA 459
pushad  ;save all registers
460
	push dword lib_name
461
	push dword dir_path
462
	push dword lib_path
463
	push dword point_dir_name
464
	call @copy_path
1108 Lrz 465
 
6245 IgorA 466
	add  esp,16
467
	;notify_window_run lib_path ;unblok for test load path
468
popad   ;restore all registers
1108 Lrz 469
}
470
 
3374 IgorA 471
; готовим текст для показа через @notify:
472
; 1) выделяем память в [arrea_xx]
473
; 2) копируем err_message и head в [arrea_xx]
1108 Lrz 474
macro show_error_window  err_message, head
3374 IgorA 475
{
476
local lp0
477
local lp1
1108 Lrz 478
 
3374 IgorA 479
pushad
480
	mcall 68,11
481
	mcall 68,12,4096
482
	push eax
483
	pop dword [arrea_xx]
1108 Lrz 484
 
3374 IgorA 485
	mov edi,eax
486
	mov esi,dword head
487
	cld
488
align 4
489
lp0:
490
	movsb
491
	cmp byte[esi],0
492
	jne lp0
493
	mov word[edi],'. '
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  ;увы
1108 Lrz 504
}
505
 
3374 IgorA 506
; включаем показ сообщения через @notify:
507
macro notify_window_run message
508
{
509
push eax ebx
510
	mov eax,message ;параметры для командной строки
511
	mov [run_notify_struct.Flags], eax
512
	mov eax,70 ;run @notify
513
	mov ebx,run_notify_struct
514
	int 0x40
515
pop ebx eax
516
}
1108 Lrz 517
 
3374 IgorA 518
 
519
;входные параметры:
520
;eax - адрес библиотеки в памяти
521
;myimport - импортируемые функции
1127 Lrz 522
macro import_boxlib myimport, err_message_import__, head_f_i__
1108 Lrz 523
{
524
local import_loop
525
local import_find
526
local lp
527
local import_find_next
528
local import_found
529
local import_done
530
local exit
531
local e.exit
532
local import_not_found
533
; initialize import
534
 
535
        mov     edx, eax
536
        mov     esi,myimport
537
import_loop:
3374 IgorA 538
        lodsd	;mov eax,dword[esi] ;add esi,4 ;получаем в eax указатель на имя импортируемой функции
1108 Lrz 539
        test    eax, eax
3374 IgorA 540
        jz      import_done ;если указатель на имя функции = 0 (в пользовательской программе)
541
        push    edx ;сохраняем начало библиотечных указателей на функции
1108 Lrz 542
import_find:
543
        mov     ebx, [ds:edx]
544
        test    ebx, ebx
3374 IgorA 545
        jz      import_not_found ;если указатель на имя функции = 0 (в библиотеке)
546
        push    eax ;eax - указатель на имя экспортируемой функции (в пользовательской программе)
1108 Lrz 547
lp:
548
        mov     cl, [ds:eax]
3374 IgorA 549
        cmp     cl, [ds:ebx] ;сравниваем имена функций в библиотеке и в пользовательской программе
550
        jnz     import_find_next ;если названия не совпали
1108 Lrz 551
        test    cl, cl
3374 IgorA 552
        jz      import_found ;если названия совпали, и уже конец строки (cl=0)
1108 Lrz 553
        inc     eax
554
        inc     ebx
555
        jmp     lp
556
import_find_next:
557
        pop     eax
3374 IgorA 558
        add     edx, 8 ;8 = 4 байта указатель на название и 4 байта указатель на функцию
1108 Lrz 559
        jmp     import_find
560
import_found:
3374 IgorA 561
        pop     ebx ;востанавливаем указатель на имя функции (который был в eax) и освобождаем стек
562
        mov     eax, [ds:edx+4] ;eax = указатель на функцию (в библиотеке)
563
        mov     [esi-4], eax ;копируем указатель (на функцию) в программу, -4 ставим потому что esi было сдвинуто командой lodsd
564
        pop     edx ;устанавливаем edx на начало библиотечных функций
565
;--- проверяем совпадает ли имя экспортированной функции с 'lib_init'
1488 IgorA 566
if library_fun_memory_alloc eq 0
567
else
568
		cmp dword[ebx],'lib_'
569
		jne		import_loop
570
		cmp dword[ebx+4],'init'
571
		jne		import_loop
3374 IgorA 572
;--- если имя функции совпало с 'lib_init' попадаем сюда
573
		;подключение функций для работы с памятью
1488 IgorA 574
		;push eax
575
		;call dll.Init
576
		pushad
577
		mov esi,eax
578
		mov	eax,library_fun_memory_alloc
579
		mov	ebx,library_fun_memory_free
580
		mov	ecx,library_fun_memory_realloc
581
		mov	edx,library_fun_dll_load
582
		call dword esi
583
		popad
584
end if
1108 Lrz 585
        jmp     import_loop
586
import_not_found:
587
        add     esp,4
1127 Lrz 588
        show_error_window  err_message_import__, head_f_i__    ;show error message /create window
1108 Lrz 589
        jmp     e.exit
590
import_done:
3374 IgorA 591
        xor     eax,eax ;=0 все загрузилось удачно
1108 Lrz 592
e.exit:
593
;---------------------------------------------------------------------
594
}
1204 Lrz 595
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
1108 Lrz 597
{
3374 IgorA 598
.library_name__           dd library_name__        ; имя загружаемой библиотеки
599
.cur_dir_path__           dd cur_dir_path__        ; указатель на буфер в котором содержиться путь от куда была запущена программа
1127 Lrz 600
 
3374 IgorA 601
.library_path__           dd library_path__        ; указатель на буфер в котором будет софоримирован путь к библиотеки, если нужно вычислить путь до либы с места запуска программы, обычно нужно, в случаях, если либа расположена в той же папке
602
.complete_path            dd system_path__         ; путь который четко содержит путь
1127 Lrz 603
 
604
.err_message_found_lib__  dd err_message_found_lib__
605
.head_f_l__               dd head_f_l__
1204 Lrz 606
.my_import                dd my_import
1127 Lrz 607
.err_message_import__     dd err_message_import__
608
.head_f_i__               dd head_f_i__
1204 Lrz 609
if point_dir_name eq
610
.point_dir_name__	dd 0x0
611
else
3374 IgorA 612
.point_dir_name__	dd point_dir_name	   ; имя вложенной дирректории в кторой храняться подгружаемые модули.
1204 Lrz 613
end if
1127 Lrz 614
.adr_load_lib           dd 0x0
615
.status_lib             dd 0x0          ;status of load library
1108 Lrz 616
;
617
}