Subversion Repositories Kolibri OS

Rev

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

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