Added entry point flags -noimport, -norelay, -ret64 and -i386.

Replaced 'byte', 'word' and 'long' by 'variable' and made it work for
Win32 too.
Made parser more robust against truncated files.
This commit is contained in:
Alexandre Julliard 2000-11-26 04:31:48 +00:00
parent 5298812be1
commit 39b3195ce6
9 changed files with 337 additions and 266 deletions

View File

@ -365,7 +365,7 @@ debug_channels (crtdll)
@ cdecl cosh(double) cosh
@ cdecl ctime(ptr) ctime
@ cdecl difftime(long long) CRTDLL_difftime
@ cdecl div(long long) CRTDLL_div
@ cdecl -noimport div(long long) CRTDLL_div
@ cdecl exit(long) CRTDLL_exit
@ cdecl exp(double) exp
@ cdecl fabs(double) fabs
@ -428,7 +428,7 @@ debug_channels (crtdll)
@ cdecl isxdigit(long) CRTDLL_isxdigit
@ cdecl labs(long) labs
@ cdecl ldexp(double long) CRTDLL_ldexp
@ cdecl ldiv(long long) CRTDLL_ldiv
@ cdecl -noimport ldiv(long long) CRTDLL_ldiv
@ stub localeconv
@ cdecl localtime(ptr) localtime
@ cdecl log(double) log

View File

@ -276,7 +276,7 @@ owner kernel32
327 register K327() HandleParamError
328 pascal16 _DebugOutput() _DebugOutput
329 pascal16 K329(str word) DebugFillBuffer
332 long THHOOK(0 0 0 0 0 0 0 0)
332 variable THHOOK(0 0 0 0 0 0 0 0)
334 pascal16 IsBadReadPtr(segptr word) IsBadReadPtr16
335 pascal16 IsBadWritePtr(segptr word) IsBadWritePtr16
336 pascal16 IsBadCodePtr(segptr) IsBadCodePtr16
@ -285,7 +285,7 @@ owner kernel32
339 pascal16 DiagQuery() DiagQuery16
340 pascal16 DiagOutput(str) DiagOutput16
341 pascal ToolHelpHook(ptr) ToolHelpHook16
342 word __GP(0 0 0 0)
342 variable __GP(0 0)
343 stub RegisterWinOldApHook
344 stub GetWinOldApHooks
345 pascal16 IsSharedSelector(word) IsSharedSelector16

View File

@ -18,15 +18,15 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
# - code generated by the MS Thunk Compiler
# - symbols exported by the Oct 94 beta version of kernel32.dll
1 register VxDCall0(long) VxDCall
2 register VxDCall1(long) VxDCall
3 register VxDCall2(long) VxDCall
4 register VxDCall3(long) VxDCall
5 register VxDCall4(long) VxDCall
6 register VxDCall5(long) VxDCall
7 register VxDCall6(long) VxDCall
8 register VxDCall7(long) VxDCall
9 register VxDCall8(long) VxDCall
1 register -i386 VxDCall0(long) VxDCall
2 register -i386 VxDCall1(long) VxDCall
3 register -i386 VxDCall2(long) VxDCall
4 register -i386 VxDCall3(long) VxDCall
5 register -i386 VxDCall4(long) VxDCall
6 register -i386 VxDCall5(long) VxDCall
7 register -i386 VxDCall6(long) VxDCall
8 register -i386 VxDCall7(long) VxDCall
9 register -i386 VxDCall8(long) VxDCall
10 forward k32CharToOemA user32.CharToOemA
11 forward k32CharToOemBuffA user32.CharToOemBuffA
12 forward k32OemToCharA user32.OemToCharA
@ -34,7 +34,7 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
14 forward k32LoadStringA user32.LoadStringA
15 forward k32wsprintfA user32.wsprintfA
16 forward k32wvsprintfA user32.wvsprintfA
17 register CommonUnimpStub() CommonUnimpStub
17 register -i386 CommonUnimpStub() CommonUnimpStub
18 stdcall GetProcessDword(long long) GetProcessDword
19 stub ThunkTheTemplateHandle
20 stub DosFileHandleToWin32Handle
@ -55,20 +55,20 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
35 stdcall LoadLibrary16(str) LoadLibrary16
36 stdcall FreeLibrary16(long) FreeLibrary16
37 stdcall GetProcAddress16(long str) WIN32_GetProcAddress16
38 register AllocMappedBuffer() AllocMappedBuffer
39 register FreeMappedBuffer() FreeMappedBuffer
40 register OT_32ThkLSF() OT_32ThkLSF
38 register -i386 AllocMappedBuffer() AllocMappedBuffer
39 register -i386 FreeMappedBuffer() FreeMappedBuffer
40 register -i386 OT_32ThkLSF() OT_32ThkLSF
41 stdcall ThunkInitLSF(long str long str str) ThunkInitLSF
42 register LogApiThkLSF(str) LogApiThkLSF
42 register -i386 LogApiThkLSF(str) LogApiThkLSF
43 stdcall ThunkInitLS(long str long str str) ThunkInitLS
44 register LogApiThkSL(str) LogApiThkSL
45 register Common32ThkLS() Common32ThkLS
44 register -i386 LogApiThkSL(str) LogApiThkSL
45 register -i386 Common32ThkLS() Common32ThkLS
46 stdcall ThunkInitSL(long str long str str) ThunkInitSL
47 register LogCBThkSL(str) LogCBThkSL
47 register -i386 LogCBThkSL(str) LogCBThkSL
48 stdcall ReleaseThunkLock(ptr) ReleaseThunkLock
49 stdcall RestoreThunkLock(long) RestoreThunkLock
50 stdcall AddAtomA(str) AddAtomA
51 register W32S_BackTo32() W32S_BackTo32
51 register -i386 W32S_BackTo32() W32S_BackTo32
52 stdcall GetThunkBuff() GetThunkBuff
53 stdcall GetThunkStuff(str str) GetThunkStuff
54 stdcall K32WOWCallback16(long long) WOWCallback16
@ -106,8 +106,8 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
86 stdcall _KERNEL32_86(ptr) _KERNEL32_86
87 stdcall SSOnBigStack() SSOnBigStack
88 varargs SSCall(long long ptr) SSCall
89 register FT_PrologPrime() FT_PrologPrime
90 register QT_ThunkPrime() QT_ThunkPrime
89 register -i386 FT_PrologPrime() FT_PrologPrime
90 register -i386 QT_ThunkPrime() QT_ThunkPrime
91 stdcall PK16FNF(ptr) PK16FNF
92 stdcall GetPK16SysVar() GetPK16SysVar
93 stdcall GetpWin16Lock(ptr) GetpWin16Lock
@ -236,23 +236,23 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
215 stdcall ExitThread(long) ExitThread
216 stdcall ExpandEnvironmentStringsA(str ptr long) ExpandEnvironmentStringsA
217 stdcall ExpandEnvironmentStringsW(wstr ptr long) ExpandEnvironmentStringsW
218 register FT_Exit0() FT_Exit0
219 register FT_Exit12() FT_Exit12
220 register FT_Exit16() FT_Exit16
221 register FT_Exit20() FT_Exit20
222 register FT_Exit24() FT_Exit24
223 register FT_Exit28() FT_Exit28
224 register FT_Exit32() FT_Exit32
225 register FT_Exit36() FT_Exit36
227 register FT_Exit40() FT_Exit40
228 register FT_Exit44() FT_Exit44
229 register FT_Exit48() FT_Exit48
226 register FT_Exit4() FT_Exit4
230 register FT_Exit52() FT_Exit52
231 register FT_Exit56() FT_Exit56
232 register FT_Exit8() FT_Exit8
233 register FT_Prolog() FT_Prolog
234 register FT_Thunk() FT_Thunk
218 register -i386 FT_Exit0() FT_Exit0
219 register -i386 FT_Exit12() FT_Exit12
220 register -i386 FT_Exit16() FT_Exit16
221 register -i386 FT_Exit20() FT_Exit20
222 register -i386 FT_Exit24() FT_Exit24
223 register -i386 FT_Exit28() FT_Exit28
224 register -i386 FT_Exit32() FT_Exit32
225 register -i386 FT_Exit36() FT_Exit36
227 register -i386 FT_Exit40() FT_Exit40
228 register -i386 FT_Exit44() FT_Exit44
229 register -i386 FT_Exit48() FT_Exit48
226 register -i386 FT_Exit4() FT_Exit4
230 register -i386 FT_Exit52() FT_Exit52
231 register -i386 FT_Exit56() FT_Exit56
232 register -i386 FT_Exit8() FT_Exit8
233 register -i386 FT_Prolog() FT_Prolog
234 register -i386 FT_Thunk() FT_Thunk
235 stdcall FatalAppExitA(long str) FatalAppExitA
236 stdcall FatalAppExitW(long wstr) FatalAppExitW
237 stub FatalExit
@ -508,8 +508,8 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
487 stub IsSLCallback
488 stdcall IsValidCodePage(long) IsValidCodePage
489 stdcall IsValidLocale(long long) IsValidLocale
490 register K32Thk1632Epilog() K32Thk1632Epilog
491 register K32Thk1632Prolog() K32Thk1632Prolog
490 register -i386 K32Thk1632Epilog() K32Thk1632Epilog
491 register -i386 K32Thk1632Prolog() K32Thk1632Prolog
492 stdcall LCMapStringA(long long str long ptr long) LCMapStringA
493 stdcall LCMapStringW(long long wstr long ptr long) LCMapStringW
494 forward LeaveCriticalSection ntdll.RtlLeaveCriticalSection
@ -534,10 +534,10 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
513 stdcall LockFileEx(long long long long long ptr) LockFileEx
514 stdcall LockResource(long) LockResource
515 stdcall MakeCriticalSectionGlobal(ptr) MakeCriticalSectionGlobal
516 register MapHInstLS() MapHInstLS
517 register MapHInstLS_PN() MapHInstLS_PN
518 register MapHInstSL() MapHInstSL
519 register MapHInstSL_PN() MapHInstSL_PN
516 register -i386 MapHInstLS() MapHInstLS
517 register -i386 MapHInstLS_PN() MapHInstLS_PN
518 register -i386 MapHInstSL() MapHInstSL
519 register -i386 MapHInstSL_PN() MapHInstSL_PN
520 stdcall MapHModuleLS(long) MapHModuleLS
521 stdcall MapHModuleSL(long) MapHModuleSL
522 stdcall MapLS(ptr) MapLS
@ -577,7 +577,7 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
556 stdcall Process32Next (ptr ptr) Process32Next
557 stdcall PulseEvent(long) PulseEvent
558 stdcall PurgeComm(long long) PurgeComm
559 register QT_Thunk() QT_Thunk
559 register -i386 QT_Thunk() QT_Thunk
560 stdcall QueryDosDeviceA(str ptr long) QueryDosDeviceA
561 stdcall QueryDosDeviceW(wstr ptr long) QueryDosDeviceW
562 stub QueryNumberOfEventLogRecords
@ -610,26 +610,26 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
589 forward RtlMoveMemory NTDLL.RtlMoveMemory
590 forward RtlUnwind NTDLL.RtlUnwind
591 forward RtlZeroMemory NTDLL.RtlZeroMemory
592 register SMapLS() SMapLS
593 register SMapLS_IP_EBP_12() SMapLS_IP_EBP_12
594 register SMapLS_IP_EBP_16() SMapLS_IP_EBP_16
595 register SMapLS_IP_EBP_20() SMapLS_IP_EBP_20
596 register SMapLS_IP_EBP_24() SMapLS_IP_EBP_24
597 register SMapLS_IP_EBP_28() SMapLS_IP_EBP_28
598 register SMapLS_IP_EBP_32() SMapLS_IP_EBP_32
599 register SMapLS_IP_EBP_36() SMapLS_IP_EBP_36
600 register SMapLS_IP_EBP_40() SMapLS_IP_EBP_40
601 register SMapLS_IP_EBP_8() SMapLS_IP_EBP_8
602 register SUnMapLS() SUnMapLS
603 register SUnMapLS_IP_EBP_12() SUnMapLS_IP_EBP_12
604 register SUnMapLS_IP_EBP_16() SUnMapLS_IP_EBP_16
605 register SUnMapLS_IP_EBP_20() SUnMapLS_IP_EBP_20
606 register SUnMapLS_IP_EBP_24() SUnMapLS_IP_EBP_24
607 register SUnMapLS_IP_EBP_28() SUnMapLS_IP_EBP_28
608 register SUnMapLS_IP_EBP_32() SUnMapLS_IP_EBP_32
609 register SUnMapLS_IP_EBP_36() SUnMapLS_IP_EBP_36
610 register SUnMapLS_IP_EBP_40() SUnMapLS_IP_EBP_40
611 register SUnMapLS_IP_EBP_8() SUnMapLS_IP_EBP_8
592 register -i386 SMapLS() SMapLS
593 register -i386 SMapLS_IP_EBP_12() SMapLS_IP_EBP_12
594 register -i386 SMapLS_IP_EBP_16() SMapLS_IP_EBP_16
595 register -i386 SMapLS_IP_EBP_20() SMapLS_IP_EBP_20
596 register -i386 SMapLS_IP_EBP_24() SMapLS_IP_EBP_24
597 register -i386 SMapLS_IP_EBP_28() SMapLS_IP_EBP_28
598 register -i386 SMapLS_IP_EBP_32() SMapLS_IP_EBP_32
599 register -i386 SMapLS_IP_EBP_36() SMapLS_IP_EBP_36
600 register -i386 SMapLS_IP_EBP_40() SMapLS_IP_EBP_40
601 register -i386 SMapLS_IP_EBP_8() SMapLS_IP_EBP_8
602 register -i386 SUnMapLS() SUnMapLS
603 register -i386 SUnMapLS_IP_EBP_12() SUnMapLS_IP_EBP_12
604 register -i386 SUnMapLS_IP_EBP_16() SUnMapLS_IP_EBP_16
605 register -i386 SUnMapLS_IP_EBP_20() SUnMapLS_IP_EBP_20
606 register -i386 SUnMapLS_IP_EBP_24() SUnMapLS_IP_EBP_24
607 register -i386 SUnMapLS_IP_EBP_28() SUnMapLS_IP_EBP_28
608 register -i386 SUnMapLS_IP_EBP_32() SUnMapLS_IP_EBP_32
609 register -i386 SUnMapLS_IP_EBP_36() SUnMapLS_IP_EBP_36
610 register -i386 SUnMapLS_IP_EBP_40() SUnMapLS_IP_EBP_40
611 register -i386 SUnMapLS_IP_EBP_8() SUnMapLS_IP_EBP_8
612 stdcall ScrollConsoleScreenBufferA(long ptr ptr ptr ptr) ScrollConsoleScreenBufferA
613 stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) ScrollConsoleScreenBufferW
614 stdcall SearchPathA(str str str long ptr ptr) SearchPathA
@ -719,7 +719,7 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
698 stdcall UTRegister(long str str str ptr ptr ptr) UTRegister
699 stdcall UTUnRegister(long) UTUnRegister
700 stdcall UnMapLS(long) UnMapLS
701 register UnMapSLFixArray(long long) UnMapSLFixArray
701 register -i386 UnMapSLFixArray(long long) UnMapSLFixArray
702 stdcall UnhandledExceptionFilter(ptr) UnhandledExceptionFilter
703 stdcall UninitializeCriticalSection(ptr) UninitializeCriticalSection
704 stdcall UnlockFile(long long long long long) UnlockFile

View File

@ -304,11 +304,11 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ stub RtlCompressBuffer
@ stub RtlConsoleMultiByteToUnicodeN
@ stub RtlConvertExclusiveToShared
@ stdcall64 RtlConvertLongToLargeInteger(long) RtlConvertLongToLargeInteger
@ stdcall -ret64 RtlConvertLongToLargeInteger(long) RtlConvertLongToLargeInteger
@ stub RtlConvertSharedToExclusive
@ stdcall RtlConvertSidToUnicodeString(ptr ptr)RtlConvertSidToUnicodeString
@ stub RtlConvertUiListToApiList
@ stdcall64 RtlConvertUlongToLargeInteger(long) RtlConvertUlongToLargeInteger
@ stdcall -ret64 RtlConvertUlongToLargeInteger(long) RtlConvertUlongToLargeInteger
@ stub RtlCopyLuid
@ stub RtlCopyLuidAndAttributesArray
@ stub RtlCopySecurityDescriptor
@ -351,9 +351,9 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ stdcall RtlDosPathNameToNtPathName_U(ptr ptr long long) RtlDosPathNameToNtPathName_U
@ stub RtlDosSearchPath_U
@ stdcall RtlDumpResource(ptr) RtlDumpResource
@ stdcall64 RtlEnlargedIntegerMultiply(long long) RtlEnlargedIntegerMultiply
@ stdcall -ret64 RtlEnlargedIntegerMultiply(long long) RtlEnlargedIntegerMultiply
@ stdcall RtlEnlargedUnsignedDivide(long long long ptr) RtlEnlargedUnsignedDivide
@ stdcall64 RtlEnlargedUnsignedMultiply(long long) RtlEnlargedUnsignedMultiply
@ stdcall -ret64 RtlEnlargedUnsignedMultiply(long long) RtlEnlargedUnsignedMultiply
@ stdcall RtlEnterCriticalSection(ptr) RtlEnterCriticalSection
@ stub RtlEnumProcessHeaps
@ stub RtlEnumerateGenericTable
@ -368,8 +368,8 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ stdcall RtlEraseUnicodeString(ptr) RtlEraseUnicodeString
@ stub RtlExpandEnvironmentStrings_U
@ stub RtlExtendHeap
@ stdcall64 RtlExtendedIntegerMultiply(long long long) RtlExtendedIntegerMultiply
@ stdcall64 RtlExtendedLargeIntegerDivide(long long long ptr) RtlExtendedLargeIntegerDivide
@ stdcall -ret64 RtlExtendedIntegerMultiply(long long long) RtlExtendedIntegerMultiply
@ stdcall -ret64 RtlExtendedLargeIntegerDivide(long long long ptr) RtlExtendedLargeIntegerDivide
@ stub RtlExtendedMagicDivide
@ stdcall RtlFillMemory(ptr long long) RtlFillMemory
@ stub RtlFillMemoryUlong
@ -429,13 +429,13 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ stub RtlIsGenericTableEmpty
@ stub RtlIsNameLegalDOS8Dot3
@ stdcall RtlIsTextUnicode(ptr long ptr) RtlIsTextUnicode
@ stdcall64 RtlLargeIntegerAdd(long long long long) RtlLargeIntegerAdd
@ stdcall64 RtlLargeIntegerArithmeticShift(long long long) RtlLargeIntegerArithmeticShift
@ stdcall64 RtlLargeIntegerDivide(long long long long ptr) RtlLargeIntegerDivide
@ stdcall64 RtlLargeIntegerNegate(long long) RtlLargeIntegerNegate
@ stdcall64 RtlLargeIntegerShiftLeft(long long long) RtlLargeIntegerShiftLeft
@ stdcall64 RtlLargeIntegerShiftRight(long long long) RtlLargeIntegerShiftRight
@ stdcall64 RtlLargeIntegerSubtract(long long long long) RtlLargeIntegerSubtract
@ stdcall -ret64 RtlLargeIntegerAdd(long long long long) RtlLargeIntegerAdd
@ stdcall -ret64 RtlLargeIntegerArithmeticShift(long long long) RtlLargeIntegerArithmeticShift
@ stdcall -ret64 RtlLargeIntegerDivide(long long long long ptr) RtlLargeIntegerDivide
@ stdcall -ret64 RtlLargeIntegerNegate(long long) RtlLargeIntegerNegate
@ stdcall -ret64 RtlLargeIntegerShiftLeft(long long long) RtlLargeIntegerShiftLeft
@ stdcall -ret64 RtlLargeIntegerShiftRight(long long long) RtlLargeIntegerShiftRight
@ stdcall -ret64 RtlLargeIntegerSubtract(long long long long) RtlLargeIntegerSubtract
@ stub RtlLargeIntegerToChar
@ stdcall RtlLeaveCriticalSection(ptr) RtlLeaveCriticalSection
@ stdcall RtlLengthRequiredSid(long) RtlLengthRequiredSid
@ -872,13 +872,13 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ stub __eFYL2X
@ stub __eFYL2XP1
@ stub __eGetStatusWord
@ stdcall64 _alldiv(long long long long) _alldiv
@ stdcall64 _allmul(long long long long) _allmul
@ register _alloca_probe() NTDLL_alloca_probe
@ stdcall64 _allrem(long long long long) _allrem
@ stdcall64 _aulldiv(long long long long) _aulldiv
@ stdcall64 _aullrem(long long long long) _aullrem
@ register _chkstk() NTDLL_chkstk
@ stdcall -ret64 _alldiv(long long long long) _alldiv
@ stdcall -ret64 _allmul(long long long long) _allmul
@ register -i386 _alloca_probe() NTDLL_alloca_probe
@ stdcall -ret64 _allrem(long long long long) _allrem
@ stdcall -ret64 _aulldiv(long long long long) _aulldiv
@ stdcall -ret64 _aullrem(long long long long) _aullrem
@ register -i386 _chkstk() NTDLL_chkstk
@ stub _fltused
@ cdecl _ftol() NTDLL__ftol
@ cdecl _itoa(long ptr long) _itoa
@ -902,8 +902,8 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ cdecl _wcsupr(wstr) NTDLL__wcsupr
@ stub abs
@ stub atan
@ cdecl atoi(str) atoi
@ cdecl atol(str) atol
@ cdecl -noimport atoi(str) atoi
@ cdecl -noimport atol(str) atol
@ stub ceil
@ stub cos
@ stub fabs
@ -920,31 +920,31 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ stub labs
@ stub log
@ cdecl mbstowcs(ptr str long) NTDLL_mbstowcs
@ cdecl memchr(ptr long long) memchr
@ cdecl memcmp(ptr ptr long) memcmp
@ cdecl memcpy(ptr ptr long) memcpy
@ cdecl memmove(ptr ptr long) memmove
@ cdecl memset(ptr long long) memset
@ cdecl -noimport memchr(ptr long long) memchr
@ cdecl -noimport memcmp(ptr ptr long) memcmp
@ cdecl -noimport memcpy(ptr ptr long) memcpy
@ cdecl -noimport memmove(ptr ptr long) memmove
@ cdecl -noimport memset(ptr long long) memset
@ cdecl pow(double double) pow
@ stub qsort
@ stub sin
@ varargs sprintf(str str) sprintf
@ stub sqrt
@ varargs sscanf() sscanf
@ cdecl strcat(str str) strcat
@ cdecl strchr(str long) strchr
@ cdecl strcmp(str str) strcmp
@ cdecl strcpy(ptr str) strcpy
@ cdecl strcspn(str str) strcspn
@ cdecl strlen(str) strlen
@ cdecl strncat(str str long) strncat
@ cdecl strncmp(str str long) strncmp
@ cdecl strncpy(ptr str long) strncpy
@ cdecl strpbrk(str str long) strpbrk
@ cdecl strrchr(str long) strrchr
@ cdecl strspn(str str) strspn
@ cdecl strstr(str str) strstr
@ cdecl strtol(str ptr long) strtol
@ cdecl -noimport strcat(str str) strcat
@ cdecl -noimport strchr(str long) strchr
@ cdecl -noimport strcmp(str str) strcmp
@ cdecl -noimport strcpy(ptr str) strcpy
@ cdecl -noimport strcspn(str str) strcspn
@ cdecl -noimport strlen(str) strlen
@ cdecl -noimport strncat(str str long) strncat
@ cdecl -noimport strncmp(str str long) strncmp
@ cdecl -noimport strncpy(ptr str long) strncpy
@ cdecl -noimport strpbrk(str str long) strpbrk
@ cdecl -noimport strrchr(str long) strrchr
@ cdecl -noimport strspn(str str) strspn
@ cdecl -noimport strstr(str str) strstr
@ cdecl -noimport strtol(str ptr long) strtol
@ varargs swprintf(wstr wstr) wsprintfW
@ stub tan
@ cdecl tolower(long) tolower
@ -1013,14 +1013,14 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
# Exception handling
@ cdecl __wine_exception_handler(ptr ptr ptr ptr) __wine_exception_handler
@ cdecl __wine_finally_handler(ptr ptr ptr ptr) __wine_finally_handler
@ cdecl -norelay __wine_exception_handler(ptr ptr ptr ptr) __wine_exception_handler
@ cdecl -norelay __wine_finally_handler(ptr ptr ptr ptr) __wine_finally_handler
# Debugging interface
@ cdecl wine_dbgstr_an(str long) wine_dbgstr_an
@ cdecl wine_dbgstr_wn(str long) wine_dbgstr_wn
@ cdecl wine_dbgstr_guid(ptr) wine_dbgstr_guid
@ cdecl wine_dbg_vprintf(str ptr) wine_dbg_vprintf
@ cdecl -norelay wine_dbgstr_an(str long) wine_dbgstr_an
@ cdecl -norelay wine_dbgstr_wn(str long) wine_dbgstr_wn
@ cdecl -norelay wine_dbgstr_guid(ptr) wine_dbgstr_guid
@ cdecl -norelay wine_dbg_vprintf(str ptr) wine_dbg_vprintf
@ varargs wine_dbg_printf(str) wine_dbg_printf
@ varargs wine_dbg_log(long str str str) wine_dbg_log

View File

@ -8,19 +8,19 @@ type win16|win32
[heap SIZE]
[init FUNCTION]
[import DLL]
[rsrc PREFIX]
[rsrc RESFILE]
ORDINAL VARTYPE EXPORTNAME (DATA [DATA [DATA [...]]])
ORDINAL FUNCTYPE [FLAGS] EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME
ORDINAL FUNCTYPE EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME
ORDINAL variable [FLAGS] EXPORTNAME (DATA [DATA [DATA [...]]])
ORDINAL stub EXPORTNAME
ORDINAL stub [FLAGS] EXPORTNAME
ORDINAL equate EXPORTNAME DATA
ORDINAL equate [FLAGS] EXPORTNAME DATA
ORDINAL extern EXPORTNAME SYMBOLNAME
ORDINAL extern [FLAGS] EXPORTNAME SYMBOLNAME
ORDINAL forward EXPORTNAME SYMBOLNAME
ORDINAL forward [FLAGS] EXPORTNAME SYMBOLNAME
# COMMENT_TEXT
@ -49,7 +49,19 @@ is loaded. This is only valid for Win32 modules.
modules at the present). The import declaration can be present several
times.
"rsrc" specifies the prefix for the resource directory name.
"rsrc" specifies the path of the compiled resource file.
"ORDINAL" specified the ordinal number corresponding to the entry
point, or "@" for automatic ordinal allocation (Win32 only).
"FLAGS" is a series of optional flags, preceded by a '-' character.
The supported flags are:
"-noimport": the entry point is not made available for importing
from winelib applications (Win32 only).
"-norelay": the entry point is not displayed in relay debugging
traces (Win32 only).
"-ret64": the function returns a 64-bit value (Win32 only).
"-i386": the entry point is only available on i386 platforms.
Lines whose first character is a '#' will be ignored as comments.
@ -57,25 +69,21 @@ Lines whose first character is a '#' will be ignored as comments.
Variable ordinals:
==================
This type defines data storage at the ordinal specified. You may
store items as bytes, 16-bit words, or 32-bit words.
"ORDINAL" is replaced by the ordinal number corresponding to the
variable. "VARTYPE" should be "byte", "word" or "long" for 8, 16, or
32 bits respectively. "EXPORTNAME" will be the name available for
dynamic linking. "DATA" can be a decimal number or a hex number preceeded
by "0x". The following example defines the variable "VariableA" at
ordinal 2 and containing 4 bytes:
This type defines data storage as 32-bit words at the ordinal specified.
"EXPORTNAME" will be the name available for dynamic linking. "DATA"
can be a decimal number or a hex number preceeded by "0x". The
following example defines the variable "VariableA" at ordinal 2 and
containing 4 ints:
2 byte VariableA(-1 0xff 0 0)
2 variable VariableA(-1 0xff 0 0)
Function ordinals:
==================
This type defines a function entry point. The prototype defined by
"EXPORTNAME ([ARGTYPE [ARGTYPE [...]]])" specifies the name available for
dynamic linking and the format of the arguments. "ORDINAL" is replaced
by the ordinal number corresponding to the function, or "@" for
automatic ordinal allocation (Win32 only).
dynamic linking and the format of the arguments. "@" can be used
instead of "EXPORTNAME" for ordinal-only exports.
"FUNCTYPE" should be one of:
- "pascal16" for a Win16 function returning a 16-bit value
@ -87,15 +95,17 @@ automatic ordinal allocation (Win32 only).
- "varargs" for a Win32 function taking a variable number of arguments
"ARGTYPE" should be one of:
- "word"
- "long"
- "ptr" (linear pointer)
- "str" (linear pointer to a null-terminated string)
- "s_word" (signed word)
- "segptr" (segmented pointer).
- "segstr" (segmented pointer to a null-terminated string)
- "word" (16-bit unsigned value)
- "s_word" (16-bit signed word)
- "long" (32-bit value)
- "double" (64-bit value)
- "ptr" (linear pointer)
- "str" (linear pointer to a null-terminated ASCII string)
- "wstr" (linear pointer to a null-terminated Unicode string)
- "segptr" (segmented pointer)
- "segstr" (segmented pointer to a null-terminated ASCII string)
Only "ptr", "str" and "long" are valid for Win32 functions.
Only "ptr", "str", "wstr", "long" and "double" are valid for Win32 functions.
"HANDLERNAME" is the name of the actual Wine function that will
process the request in 32-bit mode.
@ -129,8 +139,7 @@ Equate ordinals:
================
This type defines an ordinal as an absolute value.
"ORDINAL" is replaced by the ordinal number corresponding to the
variable. "EXPORTNAME" will be the name available for dynamic linking.
"EXPORTNAME" will be the name available for dynamic linking.
"DATA" can be a decimal number or a hex number preceeded by "0x".
Extern ordinals:

View File

@ -33,9 +33,7 @@
typedef enum
{
TYPE_BYTE, /* byte variable (Win16) */
TYPE_WORD, /* word variable (Win16) */
TYPE_LONG, /* long variable (Win16) */
TYPE_VARIABLE, /* variable */
TYPE_PASCAL_16, /* pascal function with 16-bit return (Win16) */
TYPE_PASCAL, /* pascal function with 32-bit return (Win16) */
TYPE_ABS, /* absolute value (Win16) */
@ -43,7 +41,6 @@ typedef enum
TYPE_INTERRUPT, /* interrupt handler function (Win16) */
TYPE_STUB, /* unimplemented stub */
TYPE_STDCALL, /* stdcall function (Win32) */
TYPE_STDCALL64, /* stdcall function with 64-bit return (Win32) */
TYPE_CDECL, /* cdecl function (Win32) */
TYPE_VARARGS, /* varargs function (Win32) */
TYPE_EXTERN, /* external symbol (Win32) */
@ -100,7 +97,8 @@ typedef struct
ORD_TYPE type;
int ordinal;
int offset;
int lineno;
int lineno;
int flags;
char name[80];
union
{
@ -112,6 +110,12 @@ typedef struct
} u;
} ORDDEF;
/* entry point flags */
#define FLAG_NOIMPORT 0x01 /* don't make function available for importing */
#define FLAG_NORELAY 0x02 /* don't use relay debugging for this function */
#define FLAG_RET64 0x04 /* function returns a 64-bit value */
#define FLAG_I386 0x08 /* function is i386 only */
/* Offset of a structure field relative to the start of the struct */
#define STRUCTOFFSET(type,field) ((int)&((type *)0)->field)

View File

@ -15,6 +15,7 @@
#include <string.h>
#include <unistd.h>
#include "config.h"
#include "winbase.h"
#include "build.h"
@ -29,9 +30,7 @@ static FILE *input_file;
static const char * const TypeNames[TYPE_NBTYPES] =
{
"byte", /* TYPE_BYTE */
"word", /* TYPE_WORD */
"long", /* TYPE_LONG */
"variable", /* TYPE_VARIABLE */
"pascal16", /* TYPE_PASCAL_16 */
"pascal", /* TYPE_PASCAL */
"equate", /* TYPE_ABS */
@ -39,13 +38,20 @@ static const char * const TypeNames[TYPE_NBTYPES] =
"interrupt", /* TYPE_INTERRUPT */
"stub", /* TYPE_STUB */
"stdcall", /* TYPE_STDCALL */
"stdcall64", /* TYPE_STDCALL64 */
"cdecl", /* TYPE_CDECL */
"varargs", /* TYPE_VARARGS */
"extern", /* TYPE_EXTERN */
"forward" /* TYPE_FORWARD */
};
static const char * const FlagNames[] =
{
"noimport", /* FLAG_NOIMPORT */
"norelay", /* FLAG_NORELAY */
"ret64", /* FLAG_RET64 */
"i386", /* FLAG_I386 */
NULL
};
static int IsNumberString(char *s)
{
@ -53,6 +59,11 @@ static int IsNumberString(char *s)
return 1;
}
inline static int is_token_separator( char ch )
{
return (ch == '(' || ch == ')' || ch == '-');
}
static char * GetTokenInLine(void)
{
char *p;
@ -78,8 +89,8 @@ static char * GetTokenInLine(void)
* Find end of token.
*/
token = p++;
if (*token != '(' && *token != ')')
while (*p != '\0' && *p != '(' && *p != ')' && !isspace(*p))
if (!is_token_separator(*token))
while (*p != '\0' && !is_token_separator(*p) && !isspace(*p))
p++;
ParseSaveChar = *p;
@ -89,7 +100,7 @@ static char * GetTokenInLine(void)
return token;
}
static char * GetToken(void)
static char * GetToken( int allow_eof )
{
char *token;
@ -100,7 +111,10 @@ static char * GetToken(void)
{
current_line++;
if (fgets(ParseBuffer, sizeof(ParseBuffer), input_file) == NULL)
return NULL;
{
if (!allow_eof) fatal_error( "Unexpected end of file\n" );
return NULL;
}
if (ParseBuffer[0] != '#')
break;
}
@ -116,16 +130,16 @@ static char * GetToken(void)
*/
static void ParseDebug(void)
{
char *token = GetToken();
char *token = GetToken(0);
if (*token != '(') fatal_error( "Expected '(' got '%s'\n", token );
while ((token = GetToken()))
for (;;)
{
token = GetToken(0);
if (*token == ')') break;
debug_channels = xrealloc( debug_channels,
(nb_debug_channels + 1) * sizeof(*debug_channels));
debug_channels[nb_debug_channels++] = xstrdup(token);
}
if (!token) fatal_error( "End of file in dbch declaration\n" );
}
@ -141,15 +155,16 @@ static void ParseVariable( ORDDEF *odp )
int n_values;
int value_array_size;
char *token = GetToken();
char *token = GetToken(0);
if (*token != '(') fatal_error( "Expected '(' got '%s'\n", token );
n_values = 0;
value_array_size = 25;
value_array = xmalloc(sizeof(*value_array) * value_array_size);
while ((token = GetToken()) != NULL)
for (;;)
{
token = GetToken(0);
if (*token == ')')
break;
@ -164,9 +179,6 @@ static void ParseVariable( ORDDEF *odp )
if (endptr == NULL || *endptr != '\0')
fatal_error( "Expected number value, got '%s'\n", token );
}
if (token == NULL)
fatal_error( "End of file in variable declaration\n" );
odp->u.var.n_values = n_values;
odp->u.var.values = xrealloc(value_array, sizeof(*value_array) * n_values);
@ -186,7 +198,7 @@ static void ParseExportFunction( ORDDEF *odp )
switch(SpecType)
{
case SPEC_WIN16:
if (odp->type == TYPE_STDCALL || odp->type == TYPE_STDCALL64)
if (odp->type == TYPE_STDCALL)
fatal_error( "'stdcall' not supported for Win16\n" );
if (odp->type == TYPE_VARARGS)
fatal_error( "'varargs' not supported for Win16\n" );
@ -199,12 +211,12 @@ static void ParseExportFunction( ORDDEF *odp )
break;
}
token = GetToken();
token = GetToken(0);
if (*token != '(') fatal_error( "Expected '(' got '%s'\n", token );
for (i = 0; i < sizeof(odp->u.func.arg_types); i++)
{
token = GetToken();
token = GetToken(0);
if (*token == ')')
break;
@ -247,7 +259,9 @@ static void ParseExportFunction( ORDDEF *odp )
odp->u.func.arg_types[i] = '\0';
if ((odp->type == TYPE_STDCALL) && !i)
odp->type = TYPE_CDECL; /* stdcall is the same as cdecl for 0 args */
strcpy(odp->u.func.link_name, GetToken());
if (odp->type == TYPE_VARARGS)
odp->flags |= FLAG_NORELAY; /* no relay debug possible for varags entry point */
strcpy(odp->u.func.link_name, GetToken(0));
}
@ -260,7 +274,7 @@ static void ParseEquate( ORDDEF *odp )
{
char *endptr;
char *token = GetToken();
char *token = GetToken(0);
int value = strtol(token, &endptr, 0);
if (endptr == NULL || *endptr != '\0')
fatal_error( "Expected number value, got '%s'\n", token );
@ -294,14 +308,14 @@ static void ParseInterrupt( ORDDEF *odp )
if (SpecType == SPEC_WIN32)
fatal_error( "'interrupt' not supported for Win32\n" );
token = GetToken();
token = GetToken(0);
if (*token != '(') fatal_error( "Expected '(' got '%s'\n", token );
token = GetToken();
token = GetToken(0);
if (*token != ')') fatal_error( "Expected ')' got '%s'\n", token );
odp->u.func.arg_types[0] = '\0';
strcpy( odp->u.func.link_name, GetToken() );
strcpy( odp->u.func.link_name, GetToken(0) );
}
@ -313,7 +327,9 @@ static void ParseInterrupt( ORDDEF *odp )
static void ParseExtern( ORDDEF *odp )
{
if (SpecType == SPEC_WIN16) fatal_error( "'extern' not supported for Win16\n" );
strcpy( odp->u.ext.link_name, GetToken() );
strcpy( odp->u.ext.link_name, GetToken(0) );
/* 'extern' definitions are not available for implicit import */
odp->flags |= FLAG_NOIMPORT;
}
@ -325,10 +341,33 @@ static void ParseExtern( ORDDEF *odp )
static void ParseForward( ORDDEF *odp )
{
if (SpecType == SPEC_WIN16) fatal_error( "'forward' not supported for Win16\n" );
strcpy( odp->u.fwd.link_name, GetToken() );
strcpy( odp->u.fwd.link_name, GetToken(0) );
}
/*******************************************************************
* ParseFlags
*
* Parse the optional flags for an entry point
*/
static char *ParseFlags( ORDDEF *odp )
{
unsigned int i;
char *token;
do
{
token = GetToken(0);
for (i = 0; FlagNames[i]; i++)
if (!strcmp( FlagNames[i], token )) break;
if (!FlagNames[i]) fatal_error( "Unknown flag '%s'\n", token );
odp->flags |= 1 << i;
token = GetToken(0);
} while (*token == '-');
return token;
}
/*******************************************************************
* fix_export_name
*
@ -354,7 +393,7 @@ static void ParseOrdinal(int ordinal)
ORDDEF *odp = &EntryPoints[nb_entry_points++];
if (!(token = GetToken())) fatal_error( "Expected type after ordinal\n" );
token = GetToken(0);
for (odp->type = 0; odp->type < TYPE_NBTYPES; odp->type++)
if (TypeNames[odp->type] && !strcmp( token, TypeNames[odp->type] ))
@ -363,7 +402,8 @@ static void ParseOrdinal(int ordinal)
if (odp->type >= TYPE_NBTYPES)
fatal_error( "Expected type after ordinal, found '%s' instead\n", token );
if (!(token = GetToken())) fatal_error( "Expected name after type\n" );
token = GetToken(0);
if (*token == '-') token = ParseFlags( odp );
strcpy( odp->name, token );
fix_export_name( odp->name );
@ -372,26 +412,13 @@ static void ParseOrdinal(int ordinal)
switch(odp->type)
{
case TYPE_BYTE:
case TYPE_WORD:
case TYPE_LONG:
case TYPE_VARIABLE:
ParseVariable( odp );
break;
case TYPE_REGISTER:
ParseExportFunction( odp );
#ifndef __i386__
/* ignore Win32 'register' routines on non-Intel archs */
if (SpecType == SPEC_WIN32)
{
nb_entry_points--;
return;
}
#endif
break;
case TYPE_PASCAL_16:
case TYPE_PASCAL:
case TYPE_STDCALL:
case TYPE_STDCALL64:
case TYPE_VARARGS:
case TYPE_CDECL:
ParseExportFunction( odp );
@ -415,6 +442,16 @@ static void ParseOrdinal(int ordinal)
assert( 0 );
}
#ifndef __i386__
if (odp->flags & FLAG_I386)
{
/* ignore this entry point on non-Intel archs */
nb_entry_points--;
memset( odp, 0, sizeof(*odp) );
return;
}
#endif
if (ordinal != -1)
{
if (ordinal >= MAX_ORDINALS) fatal_error( "Ordinal number %d too large\n", ordinal );
@ -481,27 +518,27 @@ SPEC_TYPE ParseTopLevel( FILE *file )
input_file = file;
current_line = 1;
while ((token = GetToken()) != NULL)
while ((token = GetToken(1)) != NULL)
{
if (strcmp(token, "name") == 0)
{
strcpy(DLLName, GetToken());
strcpy(DLLName, GetToken(0));
}
else if (strcmp(token, "file") == 0)
{
strcpy(DLLFileName, GetToken());
strcpy(DLLFileName, GetToken(0));
strupper(DLLFileName);
}
else if (strcmp(token, "type") == 0)
{
token = GetToken();
token = GetToken(0);
if (!strcmp(token, "win16" )) SpecType = SPEC_WIN16;
else if (!strcmp(token, "win32" )) SpecType = SPEC_WIN32;
else fatal_error( "Type must be 'win16' or 'win32'\n" );
}
else if (strcmp(token, "mode") == 0)
{
token = GetToken();
token = GetToken(0);
if (!strcmp(token, "dll" )) SpecMode = SPEC_MODE_DLL;
else if (!strcmp(token, "guiexe" )) SpecMode = SPEC_MODE_GUIEXE;
else if (!strcmp(token, "cuiexe" )) SpecMode = SPEC_MODE_CUIEXE;
@ -511,13 +548,13 @@ SPEC_TYPE ParseTopLevel( FILE *file )
}
else if (strcmp(token, "heap") == 0)
{
token = GetToken();
token = GetToken(0);
if (!IsNumberString(token)) fatal_error( "Expected number after heap\n" );
DLLHeapSize = atoi(token);
}
else if (strcmp(token, "init") == 0)
{
strcpy(DLLInitFunc, GetToken());
strcpy(DLLInitFunc, GetToken(0));
if (SpecType == SPEC_WIN16)
fatal_error( "init cannot be used for Win16 spec files\n" );
if (!DLLInitFunc[0])
@ -529,18 +566,18 @@ SPEC_TYPE ParseTopLevel( FILE *file )
{
if (SpecType != SPEC_WIN32)
fatal_error( "Imports not supported for Win16\n" );
add_import_dll( GetToken() );
add_import_dll( GetToken(0) );
}
else if (strcmp(token, "rsrc") == 0)
{
if (SpecType != SPEC_WIN16) load_res32_file( GetToken() );
else load_res16_file( GetToken() );
if (SpecType != SPEC_WIN16) load_res32_file( GetToken(0) );
else load_res16_file( GetToken(0) );
}
else if (strcmp(token, "owner") == 0)
{
if (SpecType != SPEC_WIN16)
fatal_error( "Owner only supported for Win16 spec files\n" );
strcpy( owner_name, GetToken() );
strcpy( owner_name, GetToken(0) );
}
else if (strcmp(token, "debug_channels") == 0)
{

View File

@ -204,9 +204,7 @@ static int BuildModule16( FILE *outfile, int max_code_offset,
selector = 1; /* Code selector */
break;
case TYPE_BYTE:
case TYPE_WORD:
case TYPE_LONG:
case TYPE_VARIABLE:
selector = 2; /* Data selector */
break;
@ -714,17 +712,7 @@ void BuildSpec16File( FILE *outfile )
odp->offset = LOWORD(odp->u.abs.value);
break;
case TYPE_BYTE:
odp->offset = data_offset;
data_offset += StoreVariableCode( data + data_offset, 1, odp);
break;
case TYPE_WORD:
odp->offset = data_offset;
data_offset += StoreVariableCode( data + data_offset, 2, odp);
break;
case TYPE_LONG:
case TYPE_VARIABLE:
odp->offset = data_offset;
data_offset += StoreVariableCode( data + data_offset, 4, odp);
break;

View File

@ -12,6 +12,7 @@
#include <ctype.h>
#include <unistd.h>
#include "config.h"
#include "winbase.h"
#include "wine/exception.h"
#include "build.h"
@ -24,6 +25,20 @@ static int string_compare( const void *ptr1, const void *ptr2 )
return strcmp( *str1, *str2 );
}
/*******************************************************************
* make_internal_name
*
* Generate an internal name for an entry point. Used for stubs etc.
*/
static const char *make_internal_name( const ORDDEF *odp, const char *prefix )
{
static char buffer[256];
if (odp->name[0]) sprintf( buffer, "__wine_%s_%s", prefix, odp->name );
else sprintf( buffer, "__wine_%s_%d", prefix, odp->ordinal );
return buffer;
}
/*******************************************************************
* AssignOrdinals
*
@ -166,17 +181,18 @@ static void output_exports( FILE *outfile, int nr_exports, int fwd_size )
fprintf( outfile, "%s", odp->u.ext.link_name );
break;
case TYPE_STDCALL:
case TYPE_STDCALL64:
case TYPE_VARARGS:
case TYPE_CDECL:
fprintf( outfile, "%s", odp->u.func.link_name);
break;
case TYPE_STUB:
if (odp->name[0]) fprintf( outfile, "__stub_%s", odp->name );
else fprintf( outfile, "__stub_%d", i );
fprintf( outfile, "%s", make_internal_name( odp, "stub" ) );
break;
case TYPE_REGISTER:
fprintf( outfile, "__regs_%d", i );
fprintf( outfile, "%s", make_internal_name( odp, "regs" ) );
break;
case TYPE_VARIABLE:
fprintf( outfile, "(func_ptr)%s", make_internal_name( odp, "var" ) );
break;
case TYPE_FORWARD:
fprintf( outfile, "(func_ptr)&exports.exp.forwards[%d] /* %s */",
@ -242,22 +258,21 @@ static void output_exports( FILE *outfile, int nr_exports, int fwd_size )
/* skip non-existent entry points */
if (!odp) goto ignore;
/* skip non-functions */
if ((odp->type != TYPE_STDCALL) && (odp->type != TYPE_STDCALL64) &&
(odp->type != TYPE_CDECL) && (odp->type != TYPE_REGISTER)) goto ignore;
/* skip wine internal functions */
if (!strncmp( odp->name, "wine_", 5 ) || !strncmp( odp->name, "__wine_", 7 )) goto ignore;
if ((odp->type != TYPE_STDCALL) &&
(odp->type != TYPE_CDECL) &&
(odp->type != TYPE_REGISTER)) goto ignore;
/* skip norelay entry points */
if (odp->flags & FLAG_NORELAY) goto ignore;
for (j = 0; odp->u.func.arg_types[j]; j++)
{
if (odp->u.func.arg_types[j] == 't') mask |= 1<< (j*2);
if (odp->u.func.arg_types[j] == 'W') mask |= 2<< (j*2);
}
if ((odp->flags & FLAG_RET64) && (j < 16)) mask |= 0x80000000;
switch(odp->type)
{
case TYPE_STDCALL64:
if (j < 16) mask |= 0x80000000;
/* fall through */
case TYPE_STDCALL:
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc2, 0x%04x, %s, 0x%08x }",
strlen(odp->u.func.arg_types) * sizeof(int),
@ -269,8 +284,9 @@ static void output_exports( FILE *outfile, int nr_exports, int fwd_size )
odp->u.func.link_name, mask );
break;
case TYPE_REGISTER:
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc3, 0x%04x, __regs_%d, 0x%08x }",
0x8000 | (strlen(odp->u.func.arg_types) * sizeof(int)), i, mask );
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc3, 0x%04x, %s, 0x%08x }",
0x8000 | (strlen(odp->u.func.arg_types) * sizeof(int)),
make_internal_name( odp, "regs" ), mask );
break;
default:
assert(0);
@ -291,8 +307,7 @@ static void output_exports( FILE *outfile, int nr_exports, int fwd_size )
for (i = 0; i < nb_names; i++)
{
char *p;
/* 'extern' definitions are not available for implicit import */
if (Names[i]->type == TYPE_EXTERN) continue;
if (Names[i]->flags & FLAG_NOIMPORT) continue;
/* check for invalid characters in the name */
for (p = Names[i]->name; *p; p++) if (!isalnum(*p) && *p != '_') break;
if (!*p) fprintf( outfile, "const char __wine_dllexport_%s_%s = 0;\n",
@ -343,16 +358,49 @@ static void output_stub_funcs( FILE *outfile )
for (i = 0, odp = EntryPoints; i < nb_entry_points; i++, odp++)
{
if (odp->type != TYPE_STUB) continue;
fprintf( outfile, "static void %s(void) ", make_internal_name( odp, "stub" ) );
if (odp->name[0])
fprintf( outfile, "static void __stub_%s(void) { __wine_unimplemented(\"%s\"); }\n",
odp->name, odp->name );
fprintf( outfile, "{ __wine_unimplemented(\"%s\"); }\n", odp->name );
else
fprintf( outfile, "static void __stub_%d(void) { __wine_unimplemented(\"%d\"); }\n",
odp->ordinal, odp->ordinal );
fprintf( outfile, "{ __wine_unimplemented(\"%d\"); }\n", odp->ordinal );
}
}
/*******************************************************************
* output_register_funcs
*
* Output the functions for register entry points
*/
static void output_register_funcs( FILE *outfile )
{
ORDDEF *odp;
const char *name;
int i;
fprintf( outfile, "#ifndef __GNUC__\n" );
fprintf( outfile, "static void __asm__dummy(void) {\n" );
fprintf( outfile, "#endif /* !defined(__GNUC__) */\n" );
for (i = 0, odp = EntryPoints; i < nb_entry_points; i++, odp++)
{
if (odp->type != TYPE_REGISTER) continue;
name = make_internal_name( odp, "regs" );
fprintf( outfile,
"asm(\".align 4\\n\\t\"\n"
" \".type " PREFIX "%s,@function\\n\\t\"\n"
" \"" PREFIX "%s:\\n\\t\"\n"
" \"call " PREFIX "CALL32_Regs\\n\\t\"\n"
" \".long " PREFIX "%s\\n\\t\"\n"
" \".byte %d,%d\");\n",
name, name, odp->u.func.link_name,
4 * strlen(odp->u.func.arg_types), 4 * strlen(odp->u.func.arg_types) );
}
fprintf( outfile, "#ifndef __GNUC__\n" );
fprintf( outfile, "}\n" );
fprintf( outfile, "#endif /* !defined(__GNUC__) */\n" );
}
/*******************************************************************
* BuildSpec32File
*
@ -361,7 +409,7 @@ static void output_stub_funcs( FILE *outfile )
void BuildSpec32File( FILE *outfile )
{
ORDDEF *odp;
int i, fwd_size = 0, have_regs = FALSE;
int i, j, fwd_size = 0, have_regs = FALSE;
int nr_exports, nr_imports, nr_resources, nr_debug;
int characteristics, subsystem, has_imports;
const char *init_func;
@ -408,7 +456,6 @@ void BuildSpec32File( FILE *outfile )
fprintf( outfile, "extern void %s();\n", odp->u.ext.link_name );
break;
case TYPE_STDCALL:
case TYPE_STDCALL64:
case TYPE_VARARGS:
case TYPE_CDECL:
fprintf( outfile, "extern void %s();\n", odp->u.func.link_name );
@ -417,43 +464,29 @@ void BuildSpec32File( FILE *outfile )
fwd_size += strlen(odp->u.fwd.link_name) + 1;
break;
case TYPE_REGISTER:
fprintf( outfile, "extern void __regs_%d();\n", odp->ordinal );
fprintf( outfile, "extern void %s();\n", make_internal_name( odp, "regs" ) );
have_regs = TRUE;
break;
case TYPE_STUB:
break;
case TYPE_VARIABLE:
fprintf( outfile, "unsigned int %s[%d] = {",
make_internal_name( odp, "var" ), odp->u.var.n_values );
for (j = 0; j < odp->u.var.n_values; j++)
{
fprintf( outfile, " 0x%08x", odp->u.var.values[j] );
if (j < odp->u.var.n_values-1) fputc( ',', outfile );
}
fprintf( outfile, " };\n" );
break;
default:
fprintf(stderr,"build: function type %d not available for Win32\n",
odp->type);
exit(1);
fatal_error("function type %d not available for Win32\n", odp->type);
}
}
/* Output code for all register functions */
if ( have_regs )
{
fprintf( outfile, "#ifndef __GNUC__\n" );
fprintf( outfile, "static void __asm__dummy(void) {\n" );
fprintf( outfile, "#endif /* !defined(__GNUC__) */\n" );
for (i = 0, odp = EntryPoints; i < nb_entry_points; i++, odp++)
{
if (odp->type != TYPE_REGISTER) continue;
fprintf( outfile,
"asm(\".align 4\\n\\t\"\n"
" \".type " PREFIX "__regs_%d,@function\\n\\t\"\n"
" \"" PREFIX "__regs_%d:\\n\\t\"\n"
" \"call " PREFIX "CALL32_Regs\\n\\t\"\n"
" \".long " PREFIX "%s\\n\\t\"\n"
" \".byte %d,%d\");\n",
odp->ordinal, odp->ordinal, odp->u.func.link_name,
4 * strlen(odp->u.func.arg_types),
4 * strlen(odp->u.func.arg_types) );
}
fprintf( outfile, "#ifndef __GNUC__\n" );
fprintf( outfile, "}\n" );
fprintf( outfile, "#endif /* !defined(__GNUC__) */\n" );
}
if (have_regs) output_register_funcs( outfile );
/* Output the exports and relay entry points */