Came across another Win CE build issue in the current stunnel 4.54 version.
Got link error for main_execute() referenced in nogui.c file.
I noticed that the implementation of "main_execute()" was in stunnel.c file in old versions, but is not there anymore.
Also got "hwnd" linking issue. Looks like "hwnd" is initialized/created in gui.c file, and used in log.c/client.c/option.c files. It is not initialized/created in nogui.c file.
I am using the NOGUIOBJS/tstunnel.exe option in building the stunnel, and got this linking error.
Any suggestions on how to fix these or work around them?
Thanks.
Robert Bao
Software House
Tyco International
978-577-4202
Explore our new Tyco Online Learning Center Web-based Training Bundles at: www.swhouse.com/support/tyco_online_learning_center.aspx
This e-mail may contain or have attached to it information or technology the export or re-export of which is restricted by U.S. laws and regulations. By viewing this e-mail and any attachments, the recipient agrees to the following: (i) the recipients use of the contents of this e-mail and any attachments shall comply with all applicable laws, rules and regulations, including, without limitation, U.S. international trade laws and regulations, and (ii) the recipient may not transfer or otherwise export or re-export any information or technology contained in this e-mail or any attachment except in full compliance with the export controls administered by the U.S. and other countries and any applicable import and use restrictions.
On 2012-12-01 00:28, Bao, Robert wrote:
Came across another Win CE build issue in the current stunnel 4.54 version.
[cut]
I am using the NOGUIOBJS/tstunnel.exe option in building the stunnel, and got this linking error.
Any suggestions on how to fix these or work around them?
Please try: https://www.stunnel.org/downloads/beta/stunnel-5.00b1.tar.gz
Best regards, Michal Trojnara
Hi Michal,
Thanks a lot for your fast turn-around fixing build issues for my head-less WinCE application.
Unfortunately the code didn't work for me right away. I spent time debugging it, and would like to pass back to you the working code so you can integrate into next release.
Here are the details:
1. evc.mak file, added Ws2.lib to LIBS: LIBS=/NODEFAULTLIB winsock.lib Ws2.lib wcecompatex.lib libeay32.lib ssleay32.lib Platform.lib coredll.lib corelibc.lib Ws2.lib resolves "WSAGetLastError()" linking error in my WinCE environment.
2. nogui.c file, added str_init() function in main() routine. str_init() is called in gui.c, but not in nogui.c :) int main(int argc, char *argv[]) { static struct WSAData wsa_state;
if(WSAStartup(MAKEWORD(1, 1), &wsa_state)) return 1;
str_init(); /* initialize per-thread string management */ main_initialize(); if(main_configure(argc>1 ? argv[1] : NULL, argc>2 ? argv[2] : NULL)) return 1; daemon_loop(); return 0; }
3. nogui.c file, added few lines to send_message() function: LRESULT send_message(const UINT Msg, const WPARAM wParam, const LPARAM lParam) { LPTSTR tstr;
tstr=str2tstr((char*) wParam); RETAILMSG(TRUE, (TEXT("%s\r\n"), tstr)); str_free(tstr);
(void)Msg; /* skip warning about unused parameter */ (void)wParam; /* skip warning about unused parameter */ (void)lParam; /* skip warning about unused parameter */ return 0L; } This is because similar lines of code have been #ifdef-ed out in log_raw() function in log.c
Last, will you let me know when is roughly the time line you will release the next version? So I don't have to keep the above changes separately?
Best Regards,
Robert Bao Software House/Tyco
-----Original Message----- From: stunnel-users-bounces@stunnel.org [mailto:stunnel-users-bounces@stunnel.org] On Behalf Of Michal Trojnara Sent: Sunday, December 02, 2012 4:22 PM To: stunnel-users@stunnel.org Subject: Re: [stunnel-users] Win CE build errors: main_execute() removed from stunnel.c file? "hwnd" link error.
On 2012-12-01 00:28, Bao, Robert wrote:
Came across another Win CE build issue in the current stunnel 4.54
version.
[cut]
I am using the NOGUIOBJS/tstunnel.exe option in building the stunnel, and got this linking error.
Any suggestions on how to fix these or work around them?
Please try: https://www.stunnel.org/downloads/beta/stunnel-5.00b1.tar.gz
Best regards, Michal Trojnara
Hi All, I used to compile stunnel and openssl on WCE and I am waiting for v500 to try again. http://delaage.pierre.free.fr
But Michal : As of 4.34 I was also suggesting to replace winsock 1 by winsock 2, not only by changing libs in makefile but also some piece of code.
But at that time, you did not agree with such a deep change in the code.
So, what 's all about now if you accept ws2.lib in the makefile ?
Anyway, I will have a look on the beta 5...
Best regards, Pierre
Le 03/12/2012 23:13, Bao, Robert a écrit :
Hi Michal,
Thanks a lot for your fast turn-around fixing build issues for my head-less WinCE application.
Unfortunately the code didn't work for me right away. I spent time debugging it, and would like to pass back to you the working code so you can integrate into next release.
Here are the details:
- evc.mak file, added Ws2.lib to LIBS:
LIBS=/NODEFAULTLIB winsock.lib Ws2.lib wcecompatex.lib libeay32.lib ssleay32.lib Platform.lib coredll.lib corelibc.lib Ws2.lib resolves "WSAGetLastError()" linking error in my WinCE environment.
- nogui.c file, added str_init() function in main() routine. str_init()
is called in gui.c, but not in nogui.c :) int main(int argc, char *argv[]) { static struct WSAData wsa_state;
if(WSAStartup(MAKEWORD(1, 1), &wsa_state)) return 1; str_init(); /* initialize per-thread string management */ main_initialize(); if(main_configure(argc>1 ? argv[1] : NULL, argc>2 ? argv[2] : NULL)) return 1; daemon_loop(); return 0;
}
- nogui.c file, added few lines to send_message() function:
LRESULT send_message(const UINT Msg, const WPARAM wParam, const LPARAM lParam) { LPTSTR tstr;
tstr=str2tstr((char*) wParam); RETAILMSG(TRUE, (TEXT("%s\r\n"), tstr)); str_free(tstr); (void)Msg; /* skip warning about unused parameter */ (void)wParam; /* skip warning about unused parameter */ (void)lParam; /* skip warning about unused parameter */ return 0L;
} This is because similar lines of code have been #ifdef-ed out in log_raw() function in log.c
Last, will you let me know when is roughly the time line you will release the next version? So I don't have to keep the above changes separately?
Best Regards,
Robert Bao Software House/Tyco
-----Original Message----- From: stunnel-users-bounces@stunnel.org [mailto:stunnel-users-bounces@stunnel.org] On Behalf Of Michal Trojnara Sent: Sunday, December 02, 2012 4:22 PM To: stunnel-users@stunnel.org Subject: Re: [stunnel-users] Win CE build errors: main_execute() removed from stunnel.c file? "hwnd" link error.
On 2012-12-01 00:28, Bao, Robert wrote:
Came across another Win CE build issue in the current stunnel 4.54
version. [cut]
I am using the NOGUIOBJS/tstunnel.exe option in building the stunnel, and got this linking error.
Any suggestions on how to fix these or work around them?
Please try: https://www.stunnel.org/downloads/beta/stunnel-5.00b1.tar.gz
Best regards, Michal Trojnara
stunnel-users mailing list stunnel-users@stunnel.org https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
On 2012-12-04 09:11, Pierre DELAAGE wrote:
I used to compile stunnel and openssl on WCE and I am waiting for v500 to try again. http://delaage.pierre.free.fr
I highly appreciate your effort.
But Michal : As of 4.34 I was also suggesting to replace winsock 1 by winsock 2, not only by changing libs in makefile but also some piece of code.
From what I understood you assume that Winsock2 implies IPv6 and related new resolver interface. This is not really true: http://goo.gl/g0B8L
While I agree that Windows 2000 compatibility is not that important anymore, I also see no real benefit in removing the legacy code. BTW: In recent beta version I moved the controversial code from gui.c to resolver.c.
I'm sure you have noticed that Win32 is not my main (nor favorite) development platform. I'm always glad to learn from your experience.
Mike
Hi Michal, So...let us stay with winsock1 code and lib, and then you can NOT accept the ws2 lib in the makefile as suggested by Robert Bao, nor my old code modif or any other #include of "winsock2.h".
No problem.
In the past, my offer was to simplify the code for "custom" rewrites of getaddrinfo/getnameinfo in resolver.c, by using winsock2 api, because such calls are available in winsock2, and NOT in winsock1.
The more simple the code is, the easier to maintain it is, and hopefully the more robust it "can" be...
Just to mention, winsock2 is available on every version of Windows including w98, WNT, w2000 and after, so that legacy OS compatibility would not be broken (and by contributing to WCE stunnel, you have noticed that I DO care also about legacy system compatibility...in every day life, because I do not want MS to obligate every one to migrate to the next version of their OS...because of lack of any good tool or service; so I try to fill the gap with some contributions).
To my experience, winsock2 offers an API more close to BSD api, more complete, and covers more protocols. And it is also still maintained by Microsoft (unlike winsock1 lib).
I will check this in depth after official stunnel v5.00.
Best regards, Pierre
Le 04/12/2012 12:19, Michal Trojnara a écrit :
On 2012-12-04 09:11, Pierre DELAAGE wrote:
I used to compile stunnel and openssl on WCE and I am waiting for v500 to try again. http://delaage.pierre.free.fr
I highly appreciate your effort.
But Michal : As of 4.34 I was also suggesting to replace winsock 1 by winsock 2, not only by changing libs in makefile but also some piece of code.
From what I understood you assume that Winsock2 implies IPv6 and related new resolver interface. This is not really true: http://goo.gl/g0B8L
While I agree that Windows 2000 compatibility is not that important anymore, I also see no real benefit in removing the legacy code. BTW: In recent beta version I moved the controversial code from gui.c to resolver.c.
I'm sure you have noticed that Win32 is not my main (nor favorite) development platform. I'm always glad to learn from your experience.
Mike
stunnel-users mailing list stunnel-users@stunnel.org https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
On 2012-12-04 13:43, Pierre DELAAGE wrote:
In the past, my offer was to simplify the code for "custom" rewrites of getaddrinfo/getnameinfo in resolver.c, by using winsock2 api, because such calls are available in winsock2, and NOT in winsock1.
You are wrong. Winsock2 does *not* imply getaddrinfo/getnameinfo. The original Windows 2000 does have Winsock2, but it doesn't have getaddrinfo/getnameinfo. Feel free do check it for yourself if you don't believe me (or Microsoft docs I sent you).
I will check this in depth after official stunnel v5.00.
Thank you.
Mike
Dear Michal, Well, I always check msdocs directly, from msdn, and I check it on local install of vstudio express embedded docs, and on embedded doc from WCE 5 sdk, and an old msdn 2000 cd I have (I am concerned with compatibility with old and new systems).
A least, I can say that the 3 functions are available in winsock2 for WCE. (ws2_lib), and on most of Windows version above or equal to xp.
And when I say winsock2 (ws2 lib) , it is not winsock1 (winsock lib).
For windows 2000 pro, check this :
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738520%28v=vs.85%2...
"....
Support for getaddrinfo on Windows 2000 and older versions
The *getaddrinfo* function was added to the Ws2_32.dll on Windows XP and later. To execute an application that uses this function on earlier versions of Windows, then you need to include the /Ws2tcpip.h/ and /Wspiapi.h/ files. When the /Wspiapi.h/ include file is added, the *getaddrinfo* function is defined to the *WspiapiGetAddrInfo* inline function in the /Wspiapi.h/ file. At runtime, the *WspiapiGetAddrInfo* function is implemented in such a way that if the Ws2_32.dll or the Wship6.dll (the file containing *getaddrinfo* in the IPv6 Technology Preview for Windows 2000) does not include *getaddrinfo*, then a version of *getaddrinfo* is implemented inline based on code in the Wspiapi.h header file. This inline code will be used on older Windows platforms that do not natively support the *getaddrinfo* function.
The IPv6 protocol is supported on Windows 2000 when the IPv6 Technology Preview for Windows 2000 is installed. Otherwise *getaddrinfo* support on versions of Windows earlier than Windows XP is limited to handling IPv4 name resolution.
The *GetAddrInfoW* http://msdn.microsoft.com/en-us/library/windows/desktop/ms738519%28v=vs.85%29.aspx function is the Unicode version of *getaddrinfo*. The *GetAddrInfoW* function was added to the Ws2_32.dll in Windows XP with Service Pack 2 (SP2). The *GetAddrInfoW* function cannot be used on versions of Windows earlier than Windows XP with SP2.
*Windows Phone 8:* This API is supported.
Requirements
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Ws2tcpip.h; Ws2tcpip.h on Windows 2000 (include Wspiapi.h)
Library
Ws2_32.lib
DLL
Ws2_32.dll
..."
My sole purpose was to replace winsock1 lib an h files with those of winsock2 (see my modified common.h I sent you in 2010/11), as winsock2 is available on many windows version, including 2000.
Some strange redef in common.h leading to compilation warnings were clarified with the distinction between winsock1 and winsock2.
Well, I think that at least for CE, the code "could" be adapted as I offered (because the present code let us think that getaddrinfo is NOT available in ws2 lib, and IT IS: http://msdn.microsoft.com/en-us/library/aa915647.aspx ).
Well, I will wait for v500 official and maybe suggest an adaptation for WCE or JUST FOR W2000...
Yours sincerely, Pierre
Le 06/12/2012 20:37, Michal Trojnara a écrit :
On 2012-12-04 13:43, Pierre DELAAGE wrote:
In the past, my offer was to simplify the code for "custom" rewrites of getaddrinfo/getnameinfo in resolver.c, by using winsock2 api, because such calls are available in winsock2, and NOT in winsock1.
You are wrong. Winsock2 does *not* imply getaddrinfo/getnameinfo. The original Windows 2000 does have Winsock2, but it doesn't have getaddrinfo/getnameinfo. Feel free do check it for yourself if you don't believe me (or Microsoft docs I sent you).
I will check this in depth after official stunnel v5.00.
Thank you.
Mike
stunnel-users mailing list stunnel-users@stunnel.org https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
On 2012-12-06 21:30, Pierre DELAAGE wrote:
My sole purpose was to replace winsock1 lib an h files with those of winsock2 (see my modified common.h I sent you in 2010/11), as winsock2 is available on many windows version, including 2000.
I agree with the basic idea of using Winsock2 only. I'd like to retain compatibility with vanilla W2K and Wship6.dll. I hope these goals are not mutually exclusive.
About patches: Would you be so kind to send small patches for each separate change? I really need to be able to discuss them, and decide whether to accept or reject each of them. I refuse to apply changes I don't understand, so you not only need to be right, but you also need to convince me that you are. 8-)
Thank you very much for your offer to test and fix WCE. Please take a look at the latest beta version: https://www.stunnel.org/downloads.html to help me improve quality of the final stunnel 5.00 release.
Mike
Michal, You are the commander in chief of this excellent product. So we proceed as you require.
I will check the beta this weekend, but I would not be comfortable to offer a patch on an unstable basis. can we agree that I patch some frozen code, kind of "almost definitive code" ?
By the way, for the future could we agree on a kind of "porting effort policy".
I suggest that in a first step you include every modification correcting bugs or introducing new functions, as usual, and that porting effort only come afterwards, in a second step, when no bug will be fixed or any new feature be included anymore, but only porting issues will be fixed...
Just let me know what you think, Yours sincerely, Pierre
Le 06/12/2012 22:08, Michal Trojnara a écrit :
On 2012-12-06 21:30, Pierre DELAAGE wrote:
My sole purpose was to replace winsock1 lib an h files with those of winsock2 (see my modified common.h I sent you in 2010/11), as winsock2 is available on many windows version, including 2000.
I agree with the basic idea of using Winsock2 only. I'd like to retain compatibility with vanilla W2K and Wship6.dll. I hope these goals are not mutually exclusive.
About patches: Would you be so kind to send small patches for each separate change? I really need to be able to discuss them, and decide whether to accept or reject each of them. I refuse to apply changes I don't understand, so you not only need to be right, but you also need to convince me that you are. 8-)
Thank you very much for your offer to test and fix WCE. Please take a look at the latest beta version: https://www.stunnel.org/downloads.html to help me improve quality of the final stunnel 5.00 release.
Mike
stunnel-users mailing list stunnel-users@stunnel.org https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
Hi again Michal, I just checked v500b3 code...
Well, I think there is some misunderstanding about winsock1 and winsock2 :
at least the purpose is to have consistant use of winsock1 H files AND lib, OR winsock2 H files AND lib.
Secondly, the purpose is to make use of wsock2 when and WHERE it REALLY exist (ie is available).
To make it more clear : winsock2 and getaddrinfo ARE AVAILABLE and working on WCE : the V434 code was assuming that getaddrinfo was NOT existing in WCE, which is just wrong. And then, in V434, the code for common.h was containing this :
#ifdef _WIN32_WCE #include <winsock.h> #else #include <winsock2.h> #include <ws2tcpip.h> #endif
meaning : use of wsock1 in WCE. THAT was leading to compilation warnng about various #define that need -strangely- redef in winsock2, but are available in winsock1 (still following me ?...).
Example : this is required in common.h if using wsock2, but NOT if using wsock1. My 2010/11 code was fixing all this stuff. #define ENOTSOCK WSAENOTSOCK
====
BUT today :
v500b3 common.h is JUST containing this : #ifdef USE_WIN32 #include <winsock2.h> #include <ws2tcpip.h>
well ok...nice...even for WCE...BUT inconsistent with EVC.MAK calling winsock1 LIB !!!!!! and inconsistent with many #defines that are in fact REDEF of existing symbols that lead to compilation warnings.
So, I can help to make it more consistent : use of winsock.h if using winsock.lib (ie winsock 1 !), OR use of winsock2.h and ws2_lib (ie winsock2 !),
but not mixing winsock2.h and winsock1 lib !
=== Something else : in log.c, many, I should say "ALL", winsock X error codes are HARDCODED in s_strerror() : not so good for maintainability...and stability of behavior (if codes are changing in the lib...).
I can help...but would you trust me ? :-)...
I will dive in this, this week-end,
See you soon, Pierre
Le 06/12/2012 22:08, Michal Trojnara a écrit :
On 2012-12-06 21:30, Pierre DELAAGE wrote:
My sole purpose was to replace winsock1 lib an h files with those of winsock2 (see my modified common.h I sent you in 2010/11), as winsock2 is available on many windows version, including 2000.
I agree with the basic idea of using Winsock2 only. I'd like to retain compatibility with vanilla W2K and Wship6.dll. I hope these goals are not mutually exclusive.
About patches: Would you be so kind to send small patches for each separate change? I really need to be able to discuss them, and decide whether to accept or reject each of them. I refuse to apply changes I don't understand, so you not only need to be right, but you also need to convince me that you are. 8-)
Thank you very much for your offer to test and fix WCE. Please take a look at the latest beta version: https://www.stunnel.org/downloads.html to help me improve quality of the final stunnel 5.00 release.
Mike
stunnel-users mailing list stunnel-users@stunnel.org https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
On 2012-12-03 23:13, Bao, Robert wrote:
Unfortunately the code didn't work for me right away. I spent time debugging it, and would like to pass back to you the working code so you can integrate into next release.
Thank you. I already implemented some of the fixes in the latest beta version. You can find it here: https://www.stunnel.org/downloads.html
I currently don't have any support contract for WCE platform, so I don't maintain a build/test environment for this platform. This is why may abilities to support this platform are so limited.
Mike
for wce env, I will help ! Pierre
Le 06/12/2012 20:59, Michal Trojnara a écrit :
On 2012-12-03 23:13, Bao, Robert wrote:
Unfortunately the code didn't work for me right away. I spent time debugging it, and would like to pass back to you the working code so you can integrate into next release.
Thank you. I already implemented some of the fixes in the latest beta version. You can find it here: https://www.stunnel.org/downloads.html
I currently don't have any support contract for WCE platform, so I don't maintain a build/test environment for this platform. This is why may abilities to support this platform are so limited.
Mike
stunnel-users mailing list stunnel-users@stunnel.org https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users