Re: [Mingw-w64-public] [Win32 API Signature Change] Discrepancy in API signature for SymLoadModule64

2021-03-06 Thread JonY via Mingw-w64-public

On 3/7/21 7:41 AM, scr3a...@auresium.com wrote:
Mmmh somehow the attachement didn't follow my last message. Sorry for 
the spam. I hope this one will do it.


Scr3am


Patch looks good to me, applied to master branch.


OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [Win32 API Signature Change] Discrepancy in API signature for SymLoadModule64

2021-03-06 Thread scr3amer
Mmmh somehow the attachement didn't follow my last message. Sorry for 
the spam. I hope this one will do it.


Scr3am

Le 2021-03-07 07:01, JonY via Mingw-w64-public a écrit :

On 3/5/21 2:01 PM, Liu Hao wrote:

Please send the patch for review here on the mailing list.
Do not use the merge request system.

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
From f0c63b8787c803be71e6b72bf09d364a8c9ac402 Mon Sep 17 00:00:00 2001
From: Scr3amer 
Date: Sun, 7 Mar 2021 00:25:47 -0500
Subject: [PATCH] Fix SymLoadModule64 signature inconsistency with Microsoft
 official one (PSTR will now be PCSTR)

---
 mingw-w64-headers/include/psdk_inc/_dbg_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mingw-w64-headers/include/psdk_inc/_dbg_common.h b/mingw-w64-headers/include/psdk_inc/_dbg_common.h
index 81f89cbb..48f2b9d7 100644
--- a/mingw-w64-headers/include/psdk_inc/_dbg_common.h
+++ b/mingw-w64-headers/include/psdk_inc/_dbg_common.h
@@ -818,7 +818,7 @@ typedef struct _SYMSRV_INDEX_INFOW {
   WINBOOL IMAGEAPI SymGetSearchPathW(HANDLE hProcess,PWSTR SearchPath,DWORD SearchPathLength);
   WINBOOL IMAGEAPI SymSetSearchPath(HANDLE hProcess,PCSTR SearchPath);
   WINBOOL IMAGEAPI SymSetSearchPathW(HANDLE hProcess,PCWSTR SearchPath);
-  DWORD64 IMAGEAPI SymLoadModule64(HANDLE hProcess,HANDLE hFile,PSTR ImageName,PSTR ModuleName,DWORD64 BaseOfDll,DWORD SizeOfDll);
+  DWORD64 IMAGEAPI SymLoadModule64(HANDLE hProcess,HANDLE hFile,PCSTR ImageName,PCSTR ModuleName,DWORD64 BaseOfDll,DWORD SizeOfDll);
 
 #define SLMFLAG_VIRTUAL 0x1
 
-- 
2.30.0.windows.1

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [Win32 API Signature Change] Discrepancy in API signature for SymLoadModule64

2021-03-06 Thread scr3amer

Oops sorry. I thought it would have been easier with that system. My bad.

Please find the patch enclosed to this mail.

Just to be sure that it is the proper file format I used this command  
to generate it:


git format-patch -1 HEAD

Is it good ?

One last thing, pure curiosity but is there a specific reason the  
project doesn't use the PullRequest system ?


Cheers,

Scr3am



JonY via Mingw-w64-public  a écrit :


On 3/5/21 2:01 PM, Liu Hao wrote:

在 2021-03-05 08:10, scr3a...@auresium.com 写道:


Note the difference : PSTR vs PCSTR.

I replaced PSTR with PCSTR locally to fix a build issue I had and  
it was enough.


Is it a good fix ? If yes should I send a patch here on the mailing list ?




This looks like a typo. Please send a patch.



Please send the patch for review here on the mailing list.
Do not use the merge request system.




___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [Win32 API Signature Change] Discrepancy in API signature for SymLoadModule64

2021-03-06 Thread JonY via Mingw-w64-public

On 3/5/21 2:01 PM, Liu Hao wrote:

在 2021-03-05 08:10, scr3a...@auresium.com 写道:


Note the difference : PSTR vs PCSTR.

I replaced PSTR with PCSTR locally to fix a build issue I had and it 
was enough.


Is it a good fix ? If yes should I send a patch here on the mailing 
list ?





This looks like a typo. Please send a patch.



Please send the patch for review here on the mailing list.
Do not use the merge request system.


OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [Win32 API Signature Change] Discrepancy in API signature for SymLoadModule64

2021-03-06 Thread scr3amer

Hello Liu,

Thanks for the quick reply.

I submitted a pull request (hoping it makes things easier than just a  
patch in a mailing list).

https://sourceforge.net/p/mingw-w64/mingw-w64/merge-requests/17/

Cheers,
Scr3am


Liu Hao  a écrit :


在 2021-03-05 08:10, scr3a...@auresium.com 写道:


Note the difference : PSTR vs PCSTR.

I replaced PSTR with PCSTR locally to fix a build issue I had and  
it was enough.


Is it a good fix ? If yes should I send a patch here on the mailing list ?




This looks like a typo. Please send a patch.


--
Best regards,
Liu Hao






___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] mingw And dlopen

2021-03-06 Thread Biswapriyo Nath
In Microsoft Windows platform, LoadLibrary function is used to load DLLs
dynamically. Some projects do like this:

#ifdef _WIN32
ret = LoadLibrary(...)
#else
ret = dlopen(...)
#endif

If you want to use dlopen() in Microsoft Windows platform there is an
unofficial wrapper repository here
https://github.com/dlfcn-win32/dlfcn-win32.git.

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] mingw And dlopen

2021-03-06 Thread Vincent Torri
Hello

On Sat, Mar 6, 2021 at 8:48 AM Thomas Dineen  wrote:
>
> Gentle People:
>
>   Do any of you have experience with Mingw gcc and dlopen for
> dynamic (under application
> program control) loading of libs. Specifically I am looking at passing
> externs into C functions
> included in a dll library. I have been able to make this work just fine
> using gcc on Solaris and
> CentOS Linux by simply including extern statements in the lib (.so)
> source outside the function.
> Now using Mingw gcc the externs seem to be ignored and I get undeclared
> variables errors.
>  Can any of you point me to a simple (and current) example of how to
> do this?
> Why is it so different from Solaris and Linux.
> PS I am totally burned out from surfing the web and not finding a simple
> and current
> way of doing this.

It's more a Windows question than mingw one

basically :

to load the DLL : LoadLibrary()
to get the function pointer of the function in your DLL : GetProcAddress()
to free resources : FreeLibrary()

example attached

I suggest that you download dependency walker [1] to see if your
functions in your  correctly exported

hth

Vincent Torri

[1] https://dependencywalker.com/

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public