Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.development    |    Operating system development chatter    |    4,255 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 2,821 of 4,255    |
|    mutazilah@gmail.com to All    |
|    DLL    |
|    28 Aug 21 12:23:00    |
   
   From: muta...@gmail.com   
      
   I am having trouble building a DLL via what appears   
   to be the documented process, and I thought I would   
   use this opportunity to find out what a DLL actually is.   
      
   If I have two independent source files, foo.c and bar.c,   
   each with one function in it, ie foo() and bar()   
   respectively, is this something that is suitable to put   
   into a DLL, or is there an expectation that it all be   
   linked in to a single executable?   
      
   I ask because I have this code in dllcrt.c:   
      
   BOOL WINAPI DllMainCRTStartup(HINSTANCE hinstDll,   
    DWORD fdwReason,   
    LPVOID lpvReserved)   
   {   
    BOOL bRet;   
      
    /* DllMain() is optional, so it would be good to handle that case too. */   
    bRet = DllMain(hinstDll, fdwReason, lpvReserved);   
      
    return (bRet);   
   }   
      
   (apparently written by Alica).   
      
   Although the code works fine with gccwin, when I   
   tried to build my own kernel32.dll using the old   
   version of Visual Studio I have installed, I got a   
   link error which was resolved by adding an   
   underscore to the above name.   
      
   But the DLL being produced is very small and doesn't   
   contain the functions I want, and that is confirmed   
   by the link map.   
      
   Any idea what a DLL actually is?   
      
   Thanks. Paul.   
      
      
      
      
   cl -c -O2 -Oi- -Zl -GS- -nologo -D__WIN32__ -D__EXPORT__ -I ../pdpclib -I .   
   ../pdpclib/dllcrt.c   
      
   cl -c -O2 -Oi- -Zl -GS- -nologo -D__WIN32__ -D__EXPORT__ -I ../pdpclib -I .   
   kernel32.c   
   cl -c -O2 -Oi- -Zl -GS- -nologo -D__WIN32__ -D__32BIT__ -I ../pdpclib -I .   
   pos.c   
      
   rem ml -c -coff support.s   
   aswin -o support.obj support.s   
      
   rem ldwin -s -o kernel32.dll --shared --kill-at dllcrt.o kernel32.o pos.o   
   support.o   
   rem dlltwin -S aswin -k --export-all-symbols -D kernel32.dll kernel32.o -l   
   kernel32.a   
      
   cl -LD -Fm -Fekernel32.dll dllcrt.obj kernel32.obj pos.obj support.obj   
      
      
      
    kernel32   
      
    Timestamp is 612a6f08 (Sun Aug 29 03:14:48 2021)   
      
    Preferred load address is 10000000   
      
    Start Length Name Class   
    0001:00000000 00000200H .text CODE   
    0002:00000000 00000000H .data DATA   
    0002:00000000 00000010H .bss DATA   
      
    Address Publics by Value Rva+Base Lib:Object   
      
    0000:00000000 ___safe_se_handler_table 00000000
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca