Problem accessing libio functions from library

Applications development, KoOS API questions
  • You are not importing libio in the mylib, lib_init gives you dll.load pointer — use it for that (you don't need to save it, nor include dll.inc it the library).
  • I have imported libio in mylib actually.

    By the way, problem got solved.

    I replaced lib_init code with following :

    Code: Select all

    proc lib_init
             	 mov     [mem.alloc], eax
              	mov     [mem.free], ebx
             	 mov     [mem.realloc], ecx
             	 mov     [dll.load], edx
                	
              	invoke	dll.load, @IMPORT
          	  	or	eax, eax
          	  	jz	.libok
    
          	  	DEBUGF 3, "ERROR : Problem Initializing libraries.\n"
          	 	 xor	eax, eax
          	  	inc	eax
          	  	ret
    
      .libok:	DEBUGF 2, "INFO : Library Initialized Successfully.\n"
           		xor	eax,eax
    		ret
    endp
    
    As per discussion with Ivan, We have concluded following :
    " Previously, I had two file.size variables. One in library and another in application.
    Without dll.load at lib_init, a call to file.size was refering to some garbage address as file.size was unitialized for library.
    Now including dll.load code at lib_init, intialized file.size to correct address."

    @Pathoswithin, Yes I do not need to include dll.inc as lib_init is giving me pointer to dll.load anyway. :)

    Thanks.
  • Who is online

    Users browsing this forum: No registered users and 5 guests