Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
15751f20
Commit
15751f20
authored
Oct 07, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhlp32: Don't use FARPROC for functions that take variable number of arguments.
parent
e2d22db7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
12 deletions
+57
-12
macro.c
programs/winhlp32/macro.c
+0
-0
macro.lex.l
programs/winhlp32/macro.lex.l
+57
-12
No files found.
programs/winhlp32/macro.c
View file @
15751f20
This diff is collapsed.
Click to expand it.
programs/winhlp32/macro.lex.l
View file @
15751f20
...
...
@@ -152,7 +152,7 @@ static const char* ts(int t)
}
}
static int MACRO_CallBoolFunc(
FARPROC
fn, const char* args, void** ret);
static int MACRO_CallBoolFunc(
void *
fn, const char* args, void** ret);
/******************************************************************
* MACRO_CheckArgs
...
...
@@ -222,7 +222,7 @@ CheckArgs_end:
* Invokes boolean function fn, which arguments are defined by args
* stores bool result into ret
*/
static int MACRO_CallBoolFunc(
FARPROC
fn, const char* args, void** ret)
static int MACRO_CallBoolFunc(
void *
fn, const char* args, void** ret)
{
void* pa[2];
int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args);
...
...
@@ -234,8 +234,18 @@ static int MACRO_CallBoolFunc(FARPROC fn, const char* args, void** ret)
switch (strlen(args))
{
case 0: *ret = (void*)(fn)(); break;
case 1: *ret = (void*)(fn)(pa[0]); break;
case 0:
{
BOOL (WINAPI *func)(void) = fn;
*ret = (void *)(ULONG_PTR)func();
break;
}
case 1:
{
BOOL (WINAPI *func)(void *) = fn;
*ret = (void *)(ULONG_PTR)func( pa[0]);
break;
}
default: WINE_FIXME("NIY\n");
}
...
...
@@ -247,7 +257,7 @@ static int MACRO_CallBoolFunc(FARPROC fn, const char* args, void** ret)
*
*
*/
static int MACRO_CallVoidFunc(
FARPROC
fn, const char* args)
static int MACRO_CallVoidFunc(
void *
fn, const char* args)
{
void* pa[6];
int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args);
...
...
@@ -259,13 +269,48 @@ static int MACRO_CallVoidFunc(FARPROC fn, const char* args)
switch (strlen(args))
{
case 0: (fn)(); break;
case 1: (fn)(pa[0]); break;
case 2: (fn)(pa[0],pa[1]); break;
case 3: (fn)(pa[0],pa[1],pa[2]); break;
case 4: (fn)(pa[0],pa[1],pa[2],pa[3]); break;
case 5: (fn)(pa[0],pa[1],pa[2],pa[3],pa[4]); break;
case 6: (fn)(pa[0],pa[1],pa[2],pa[3],pa[4],pa[5]); break;
case 0:
{
void (WINAPI *func)(void) = fn;
func();
break;
}
case 1:
{
void (WINAPI *func)(void*) = fn;
func( pa[0] );
break;
}
case 2:
{
void (WINAPI *func)(void*,void*) = fn;
func( pa[0], pa[1] );
break;
}
case 3:
{
void (WINAPI *func)(void*,void*,void*) = fn;
func( pa[0], pa[1], pa[2] );
break;
}
case 4:
{
void (WINAPI *func)(void*,void*,void*,void*) = fn;
func( pa[0], pa[1], pa[2], pa[3] );
break;
}
case 5:
{
void (WINAPI *func)(void*,void*,void*,void*,void*) = fn;
func( pa[0], pa[1], pa[2], pa[3], pa[4] );
break;
}
case 6:
{
void (WINAPI *func)(void*,void*,void*,void*,void*,void*) = fn;
func( pa[0], pa[1], pa[2], pa[3], pa[4], pa[5] );
break;
}
default: WINE_FIXME("NIY\n");
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment