parent
718b1b711b
commit
aa4efd49b1
|
@ -12,6 +12,8 @@ UINT
|
|||
int
|
||||
|
||||
%ptr
|
||||
|
||||
ABORTPROC16
|
||||
BITMAP16 *
|
||||
BITMAPINFO *
|
||||
BITMAPINFOHEADER *
|
||||
|
|
|
@ -54,6 +54,7 @@ UINT16 *
|
|||
WINDOWPLACEMENT16 *
|
||||
WNDCLASS16 *
|
||||
WNDCLASSEX16 *
|
||||
WNDPROC
|
||||
WORD *
|
||||
void *
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ BITMAP *
|
|||
BITMAPINFO *
|
||||
BITMAPINFOHEADER *
|
||||
COLORADJUSTMENT *
|
||||
DCHOOKPROC
|
||||
DEVMODEA *
|
||||
DEVMODEW *
|
||||
DOCINFOA *
|
||||
|
|
|
@ -49,6 +49,7 @@ UINT16
|
|||
|
||||
BOOL *
|
||||
BY_HANDLE_FILE_INFORMATION *
|
||||
CHAR_INFO *
|
||||
DWORD *
|
||||
CALINFO_ENUMPROCA
|
||||
CONTEXT *
|
||||
|
|
|
@ -27,14 +27,16 @@ ULONGLONG
|
|||
__non_rtti_object *
|
||||
_HEAPINFO *
|
||||
_INITTERMFUN *
|
||||
_JUMP_BUFFER *
|
||||
_onexit_t
|
||||
_onexit_t **
|
||||
LPDWORD *
|
||||
MSVCRT_EXCEPTION_FRAME *
|
||||
MSVCRT_FILE *
|
||||
MSVCRT_compar_fn_t
|
||||
MSVCRT_exception *
|
||||
MSVCRT_fpos_t *
|
||||
MSVCRT_free_func
|
||||
MSVCRT_malloc_func
|
||||
MSVCRT_matherr_func
|
||||
MSVCRT_new_handler_func
|
||||
MSVCRT_sig_handler_func
|
||||
|
@ -56,7 +58,8 @@ char **
|
|||
char ***
|
||||
exception *
|
||||
int *
|
||||
jmp_buf
|
||||
struct __EXCEPTION_FRAME *
|
||||
struct __EXCEPTION_FRAME **
|
||||
struct _finddata_t *
|
||||
struct _diskfree_t *
|
||||
struct _stat *
|
||||
|
|
|
@ -36,7 +36,6 @@ WCHAR
|
|||
|
||||
int
|
||||
long
|
||||
size_t
|
||||
unsigned int
|
||||
unsigned long
|
||||
|
||||
|
@ -69,6 +68,7 @@ PACE_HEADER *
|
|||
PACL
|
||||
PACL *
|
||||
PBOOLEAN
|
||||
PCVOID
|
||||
PDWORD
|
||||
PEXCEPTION_FRAME
|
||||
PEXCEPTION_RECORD
|
||||
|
@ -103,18 +103,17 @@ ULONGLONG *
|
|||
UNICODE_STRING *
|
||||
VOID *
|
||||
struct _TEB *
|
||||
union cptable *
|
||||
void *
|
||||
|
||||
%ptr --extension
|
||||
|
||||
EXCEPTION_FRAME **
|
||||
GUID *
|
||||
WCHAR *
|
||||
WCHAR ***
|
||||
char *
|
||||
char ***
|
||||
enum __DEBUG_CLASS
|
||||
union generic_request *
|
||||
va_list
|
||||
|
||||
%str
|
||||
|
|
|
@ -8,6 +8,7 @@ HBITMAP
|
|||
HDROP
|
||||
HGLOBAL
|
||||
HMENU
|
||||
HMODULE
|
||||
HICON
|
||||
HINSTANCE
|
||||
HIMAGELIST
|
||||
|
@ -22,7 +23,6 @@ ULONG
|
|||
WORD
|
||||
WPARAM
|
||||
|
||||
|
||||
%long # --forbidden
|
||||
|
||||
int
|
||||
|
@ -32,6 +32,7 @@ int
|
|||
CLSID *
|
||||
DLLVERSIONINFO *
|
||||
DWORD *
|
||||
FARPROC
|
||||
HICON *
|
||||
HIMAGELIST *
|
||||
HWND *
|
||||
|
|
|
@ -15,8 +15,10 @@ HMENU
|
|||
HMODULE
|
||||
HPALETTE
|
||||
HRESULT
|
||||
HSHARED
|
||||
HUSKEY
|
||||
HWND
|
||||
LANGID
|
||||
LPARAM
|
||||
LRESULT
|
||||
UCHAR
|
||||
|
@ -37,15 +39,19 @@ int
|
|||
BOOL *
|
||||
DLLVERSIONINFO *
|
||||
HICON *
|
||||
IFACE_INDEX_TBL *
|
||||
IStream *
|
||||
ITEMIDLIST *
|
||||
IUnknown *
|
||||
IUnknown **
|
||||
LPBROWSEINFOW
|
||||
LPBYTE
|
||||
LPCITEMIDLIST
|
||||
LPCLSID
|
||||
LPCSTR *
|
||||
LPCVOID
|
||||
LPCWSTR *
|
||||
LPDWORD
|
||||
LPHWND
|
||||
LPINT
|
||||
LPITEMIDLIST
|
||||
LPOPENFILENAMEW
|
||||
|
@ -57,7 +63,9 @@ LPSTRRET
|
|||
LPUNKNOWN *
|
||||
LPVOID
|
||||
LPVOID *
|
||||
LPWORD
|
||||
PHUSKEY
|
||||
PVOID
|
||||
REFIID
|
||||
REFGUID
|
||||
SHFILEINFOW *
|
||||
|
|
|
@ -5,7 +5,6 @@ CHAR
|
|||
COLORREF
|
||||
DWORD
|
||||
INT
|
||||
HANDLE
|
||||
HDC
|
||||
HBITMAP
|
||||
HGDIOBJ
|
||||
|
|
|
@ -8,8 +8,10 @@ long
|
|||
%ptr
|
||||
|
||||
IBindCtx *
|
||||
IBindCtx **
|
||||
IBindStatusCallback *
|
||||
IBindStatusCallback **
|
||||
IEnumFORMATETC *
|
||||
IMoniker *
|
||||
IMoniker **
|
||||
LPVOID *
|
||||
|
|
|
@ -53,6 +53,7 @@ BOOL16
|
|||
INT16
|
||||
HANDLE16
|
||||
HDRVR16
|
||||
HGLOBAL16
|
||||
HMODULE16
|
||||
HINSTANCE16
|
||||
HTASK16
|
||||
|
@ -73,6 +74,7 @@ DLGPROC
|
|||
DRAWSTATEPROC
|
||||
GRAYSTRINGPROC
|
||||
HANDLE *
|
||||
HBRUSH *
|
||||
HICON *
|
||||
HKL *
|
||||
HWND *
|
||||
|
@ -145,10 +147,6 @@ DLGPROC16
|
|||
HOOKPROC16
|
||||
WNDPROC16
|
||||
|
||||
%ptr # --forbidden
|
||||
|
||||
int *
|
||||
|
||||
%str
|
||||
|
||||
LPSTR
|
||||
|
|
|
@ -1,22 +1,14 @@
|
|||
%long
|
||||
|
||||
BOOL
|
||||
BYTE
|
||||
DWORD
|
||||
HANDLE
|
||||
INT
|
||||
UINT
|
||||
ULONG_PTR
|
||||
WORD
|
||||
|
||||
int
|
||||
|
||||
%ptr
|
||||
|
||||
CONTEXT86 *
|
||||
BYTE *
|
||||
DOSRELAY
|
||||
PAPCFUNC
|
||||
LPDOSTASK
|
||||
LPVOID
|
||||
DWORD *
|
||||
|
||||
%str
|
||||
|
||||
|
|
|
@ -2,16 +2,19 @@
|
|||
|
||||
BOOL
|
||||
DWORD
|
||||
FILETIME
|
||||
HINTERNET
|
||||
HRESULT
|
||||
INTERNET_PORT
|
||||
|
||||
%ptr
|
||||
|
||||
LPBYTE
|
||||
LPCSTR *
|
||||
LPCVOID
|
||||
LPDWORD
|
||||
LPINTERNET_BUFFERSA
|
||||
LPINTERNET_CACHE_ENTRY_INFOA
|
||||
LPURL_COMPONENTSA
|
||||
LPVOID
|
||||
LPWIN32_FIND_DATAA
|
||||
|
|
|
@ -237,16 +237,24 @@ sub parse_spec_file {
|
|||
|
||||
my $ordinal;
|
||||
if(/^(\d+|@)\s+
|
||||
(pascal|pascal16|stdcall|cdecl|register|interrupt|varargs)
|
||||
(?:\s+(?:-noimport|-norelay|-i386|-ret64))*\s+(\S+)\s*\(\s*(.*?)\s*\)\s*(\S+)$/x)
|
||||
(pascal|pascal16|stdcall|cdecl|varargs)\s+
|
||||
((?:(?:-noimport|-norelay|-i386|-ret64|-register|-interrupt)\s+)*)(\S+)\s*\(\s*(.*?)\s*\)\s*(\S+)$/x)
|
||||
{
|
||||
my $calling_convention = $2;
|
||||
my $external_name = $3;
|
||||
my $arguments = $4;
|
||||
my $internal_name = $5;
|
||||
my $flags = $3;
|
||||
my $external_name = $4;
|
||||
my $arguments = $5;
|
||||
my $internal_name = $6;
|
||||
|
||||
$ordinal = $1;
|
||||
|
||||
$flags =~ s/\s+/ /g;
|
||||
|
||||
if($flags =~ /(?:-register|-interrupt)/) {
|
||||
if($arguments) { $arguments .= " "; }
|
||||
$arguments .= "ptr";
|
||||
}
|
||||
|
||||
if(!$$function_internal_name{$external_name}) {
|
||||
$$function_internal_name{$external_name} = $internal_name;
|
||||
} else {
|
||||
|
|
|
@ -127,16 +127,7 @@ sub _check_function {
|
|||
my $declared_calling_convention = $winapi->function_internal_calling_convention($internal_name);
|
||||
my @declared_argument_kinds = split(/\s+/, $winapi->function_internal_arguments($internal_name));
|
||||
|
||||
if($declared_calling_convention =~ /^register|interrupt$/) {
|
||||
push @declared_argument_kinds, "ptr";
|
||||
}
|
||||
|
||||
if($declared_calling_convention =~ /^register|interupt$/ &&
|
||||
(($winapi->name eq "win32" && $implemented_calling_convention eq "stdcall") ||
|
||||
(($winapi->name eq "win16" && $implemented_calling_convention =~ /^pascal/))))
|
||||
{
|
||||
# correct
|
||||
} elsif($implemented_calling_convention ne $declared_calling_convention &&
|
||||
if($implemented_calling_convention ne $declared_calling_convention &&
|
||||
$implemented_calling_convention ne "asm" &&
|
||||
!($declared_calling_convention =~ /^pascal/ && $forbidden_return_type) &&
|
||||
!($implemented_calling_convention =~ /^cdecl|varargs$/ && $declared_calling_convention =~ /^cdecl|varargs$/))
|
||||
|
@ -178,7 +169,9 @@ sub _check_function {
|
|||
my $type = $_;
|
||||
my $kind = "unknown";
|
||||
$winapi->type_used_in_module($type,$module);
|
||||
if(!defined($kind = $winapi->translate_argument($type))) {
|
||||
if($type eq "CONTEXT86 *") {
|
||||
$kind = "context86";
|
||||
} elsif(!defined($kind = $winapi->translate_argument($type))) {
|
||||
$output->write("no translation defined: " . $type . "\n");
|
||||
} elsif(!$winapi->is_allowed_kind($kind) ||
|
||||
!$winapi->allowed_type_in_module($type, $module)) {
|
||||
|
@ -211,7 +204,9 @@ sub _check_function {
|
|||
$argument_types[$n] = "";
|
||||
}
|
||||
|
||||
if(!$winapi->is_allowed_kind($argument_kinds[$n]) ||
|
||||
if($argument_kinds[$n] eq "context86") {
|
||||
# Nothing
|
||||
} elsif(!$winapi->is_allowed_kind($argument_kinds[$n]) ||
|
||||
!$winapi->allowed_type_in_module($argument_types[$n], $module))
|
||||
{
|
||||
if($options->report_argument_forbidden($argument_types[$n])) {
|
||||
|
|
|
@ -528,7 +528,7 @@ sub parse_c_file {
|
|||
&$type_end([@names]);
|
||||
} elsif(/typedef\s+
|
||||
(?:(?:const\s+|enum\s+|long\s+|signed\s+|short\s+|struct\s+|union\s+|unsigned\s+)*?)
|
||||
(\w+)\s+
|
||||
(\w+(?:\s*\*+\s*)?)\s+
|
||||
(?:(\w+)\s*)?
|
||||
\((?:(\w+)\s+)?\s*\*\s*(\w+)\s*\)\s*
|
||||
(?:\(([^\)]*)\)|\[([^\]]*)\])\s*;/sx)
|
||||
|
|
Loading…
Reference in New Issue