Subversion Repositories Kolibri OS

Rev

Rev 4419 | Rev 4522 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  
  2. ; Macroinstructions for making import section
  3. ; Based on import32.inc from FASM, with small modifications
  4. ; and list of actual kernel exports.
  5.  
  6. macro library [name,string]
  7.  { common
  8.     import.data:
  9.    forward
  10.     local _label
  11.     if defined name#.redundant
  12.      if ~ name#.redundant
  13.       dd 0,0,0,RVA _label,RVA name#.address
  14.      end if
  15.     end if
  16.     name#.referred = 1
  17.    common
  18.     dd 0,0,0,0,0
  19.    forward
  20.     if defined name#.redundant
  21.      if ~ name#.redundant
  22.       _label db string,0
  23.      end if
  24.     end if }
  25.  
  26. macro import name,[label]
  27.  { common
  28.     rb (- rva $) and 3
  29.     if defined name#.referred
  30.      name#.address:
  31.    forward
  32.      if used label
  33.        local _label
  34.        label dd RVA _label
  35.        label#._pe_import = 1
  36.      end if
  37.    common
  38.      if $ > name#.address
  39.       name#.redundant = 0
  40.       dw 0
  41.      else
  42.       name#.redundant = 1
  43.      end if
  44.    forward
  45.      if used label
  46.      _label dw 0
  47.             db `label
  48.      end if
  49.    common
  50.      db 0
  51.     end if }
  52.  
  53. align 4
  54. data import
  55. library core,'core.dll'
  56. import core,\
  57.               RegService,\
  58.               GetService,\
  59.               ServiceHandler,\
  60.               AttachIntHandler,\
  61.               GetIntHandler,\
  62.               FpuSave,\
  63.               FpuRestore,\
  64.               ReservePortArea,\
  65.               Boot_Log,\
  66. \
  67.           MutexInit,\
  68.           MutexLock,\
  69.           MutexUnlock,\
  70. \
  71.               PciApi,\
  72.               PciRead32,\
  73.               PciRead16,\
  74.               PciRead8,\
  75.               PciWrite8,\
  76.               PciWrite16,\
  77.               PciWrite32,\
  78. \
  79.               AllocPage,\
  80.               AllocPages,\
  81.               FreePage,\
  82.               MapPage,\
  83.               MapSpace,\
  84.               MapIoMem,\
  85.               GetPgAddr,\
  86.               GetPhysAddr,\
  87.               CommitPages,\
  88.               ReleasePages,\
  89. \
  90.               AllocKernelSpace,\
  91.               FreeKernelSpace,\
  92.               KernelAlloc,\
  93.               KernelFree,\
  94.               UserAlloc,\
  95.               UserFree,\
  96.               Kmalloc,\
  97.               Kfree,\
  98.               CreateRingBuffer,\
  99. \
  100.               GetPid,\
  101.               CreateThread,\
  102.               CreateObject,\
  103.               DestroyObject,\
  104.               CreateEvent,\
  105.               RaiseEvent,\
  106.               WaitEvent,\
  107.               DestroyEvent,\
  108.               ClearEvent,\
  109. \
  110.               LoadCursor,\
  111.               SelectHwCursor,\
  112.               SetHwCursor,\
  113.               HwCursorRestore,\
  114.               HwCursorCreate,\
  115. \
  116.               SysMsgBoardStr,\
  117.               SysMsgBoard,\
  118.               GetCurrentTask,\
  119.               LoadFile,\
  120.               SendEvent,\
  121.               SetMouseData,\
  122.               SetKeyboardData,\
  123.               RegKeyboard,\
  124.               DelKeyboard,\
  125.               Sleep,\
  126.               GetTimerTicks,\
  127. \
  128.               strncat,\
  129.               strncpy,\
  130.               strncmp,\
  131.               strnlen,\
  132.               strchr,\
  133.               strrchr,\
  134. \
  135.               LFBAddress,\
  136.               GetDisplay,\
  137.               SetScreen,\
  138. \
  139.               RegUSBDriver,\
  140.               USBOpenPipe,\
  141.               USBNormalTransferAsync,\
  142.               USBControlTransferAsync,\
  143.               USBGetParam,\
  144.               USBHCFunc,\
  145. \
  146.               DiskAdd,\
  147.               DiskMediaChanged,\
  148.               DiskDel,\
  149. \
  150.               TimerHS,\
  151.               CancelTimerHS,\
  152. \
  153.               GetPCIList
  154. end data
  155.