Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GIMP
Commits
afe9625b
Commit
afe9625b
authored
Dec 31, 2022
by
Luca Bacci
Committed by
Jehan
Jan 24, 2023
Browse files
Simpler way to get the module HANDLE
parent
0657b852
Changes
1
Hide whitespace changes
Inline
Side-by-side
libgimpbase/gimpenv.c
View file @
afe9625b
...
...
@@ -332,28 +332,12 @@ get_special_folder (int csidl)
return
retval
;
}
static
HMODULE
libgimpbase_dll
=
NULL
;
extern
IMAGE_DOS_HEADER
__ImageBase
;
/* Minimal DllMain that just stores the handle to this DLL */
BOOL
WINAPI
/* Avoid silly "no previous prototype" gcc warning */
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
);
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
static
HMODULE
this_module
(
void
)
{
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
libgimpbase_dll
=
hinstDLL
;
break
;
}
return
TRUE
;
return
(
HMODULE
)
&
__ImageBase
;
}
#endif
...
...
@@ -389,7 +373,7 @@ gimp_installation_directory (void)
#ifdef G_OS_WIN32
toplevel
=
g_win32_get_package_installation_directory_of_module
(
libgimpbase_dll
);
toplevel
=
g_win32_get_package_installation_directory_of_module
(
this_module
()
);
if
(
!
toplevel
)
g_error
(
"g_win32_get_package_installation_directory_of_module() failed"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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