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
76695731
Commit
76695731
authored
Apr 03, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid local WINAPI function pointers to work around gcc bug.
parent
14c96c10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
ordinal.c
dlls/shlwapi/ordinal.c
+0
-0
ordinal.h
dlls/shlwapi/ordinal.h
+7
-5
path.c
dlls/shlwapi/path.c
+7
-6
No files found.
dlls/shlwapi/ordinal.c
View file @
76695731
This diff is collapsed.
Click to expand it.
dlls/shlwapi/ordinal.h
View file @
76695731
...
@@ -44,11 +44,13 @@ typedef struct {
...
@@ -44,11 +44,13 @@ typedef struct {
DWORD
WINAPI
SHLWAPI_2
(
LPCWSTR
x
,
UNKNOWN_SHLWAPI_2
*
y
);
DWORD
WINAPI
SHLWAPI_2
(
LPCWSTR
x
,
UNKNOWN_SHLWAPI_2
*
y
);
/* Macro to get function pointer for a module*/
/* Macro to get function pointer for a module*/
#define GET_FUNC(module, name, fail) \
#define GET_FUNC(func, module, name, fail) \
if (!SHLWAPI_h##module) SHLWAPI_h##module = LoadLibraryA(#module ".dll"); \
do { \
if (!SHLWAPI_h##module) return fail; \
if (!func) { \
if (!pfnFunc) pfnFunc = (void*)GetProcAddress(SHLWAPI_h##module, name); \
if (!SHLWAPI_h##module && !(SHLWAPI_h##module = LoadLibraryA(#module ".dll"))) return fail; \
if (!pfnFunc) return fail
if (!(func = (void*)GetProcAddress(SHLWAPI_h##module, name))) return fail; \
} \
} while (0)
extern
HMODULE
SHLWAPI_hshell32
;
extern
HMODULE
SHLWAPI_hshell32
;
...
...
dlls/shlwapi/path.c
View file @
76695731
...
@@ -36,6 +36,9 @@
...
@@ -36,6 +36,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
/* function pointers for GET_FUNC macro; these need to be global because of gcc bug */
static
BOOL
(
WINAPI
*
pIsNetDrive
)(
DWORD
);
/*************************************************************************
/*************************************************************************
* PathAppendA [SHLWAPI.@]
* PathAppendA [SHLWAPI.@]
*
*
...
@@ -3313,7 +3316,6 @@ VOID WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR lpszPath)
...
@@ -3313,7 +3316,6 @@ VOID WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR lpszPath)
*/
*/
BOOL
WINAPI
PathIsNetworkPathA
(
LPCSTR
lpszPath
)
BOOL
WINAPI
PathIsNetworkPathA
(
LPCSTR
lpszPath
)
{
{
static
BOOL
(
WINAPI
*
pfnFunc
)(
DWORD
);
DWORD
dwDriveNum
;
DWORD
dwDriveNum
;
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
lpszPath
));
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
lpszPath
));
...
@@ -3325,8 +3327,8 @@ BOOL WINAPI PathIsNetworkPathA(LPCSTR lpszPath)
...
@@ -3325,8 +3327,8 @@ BOOL WINAPI PathIsNetworkPathA(LPCSTR lpszPath)
dwDriveNum
=
PathGetDriveNumberA
(
lpszPath
);
dwDriveNum
=
PathGetDriveNumberA
(
lpszPath
);
if
(
dwDriveNum
==
-
1
)
if
(
dwDriveNum
==
-
1
)
return
FALSE
;
return
FALSE
;
GET_FUNC
(
shell32
,
(
LPCSTR
)
66
,
FALSE
);
/* ord 66 = shell32.IsNetDrive */
GET_FUNC
(
pIsNetDrive
,
shell32
,
(
LPCSTR
)
66
,
FALSE
);
/* ord 66 = shell32.IsNetDrive */
return
p
fnFunc
(
dwDriveNum
);
return
p
IsNetDrive
(
dwDriveNum
);
}
}
/*************************************************************************
/*************************************************************************
...
@@ -3336,7 +3338,6 @@ BOOL WINAPI PathIsNetworkPathA(LPCSTR lpszPath)
...
@@ -3336,7 +3338,6 @@ BOOL WINAPI PathIsNetworkPathA(LPCSTR lpszPath)
*/
*/
BOOL
WINAPI
PathIsNetworkPathW
(
LPCWSTR
lpszPath
)
BOOL
WINAPI
PathIsNetworkPathW
(
LPCWSTR
lpszPath
)
{
{
static
BOOL
(
WINAPI
*
pfnFunc
)(
DWORD
);
DWORD
dwDriveNum
;
DWORD
dwDriveNum
;
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
lpszPath
));
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
lpszPath
));
...
@@ -3348,8 +3349,8 @@ BOOL WINAPI PathIsNetworkPathW(LPCWSTR lpszPath)
...
@@ -3348,8 +3349,8 @@ BOOL WINAPI PathIsNetworkPathW(LPCWSTR lpszPath)
dwDriveNum
=
PathGetDriveNumberW
(
lpszPath
);
dwDriveNum
=
PathGetDriveNumberW
(
lpszPath
);
if
(
dwDriveNum
==
-
1
)
if
(
dwDriveNum
==
-
1
)
return
FALSE
;
return
FALSE
;
GET_FUNC
(
shell32
,
(
LPCSTR
)
66
,
FALSE
);
/* ord 66 = shell32.IsNetDrive */
GET_FUNC
(
pIsNetDrive
,
shell32
,
(
LPCSTR
)
66
,
FALSE
);
/* ord 66 = shell32.IsNetDrive */
return
p
fnFunc
(
dwDriveNum
);
return
p
IsNetDrive
(
dwDriveNum
);
}
}
/*************************************************************************
/*************************************************************************
...
...
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