You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by William A Rowe Jr <wr...@rowe-clan.net> on 2016/05/25 18:14:02 UTC

Re: svn commit: r1745517 - /httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c

Your comment doesn't match the code, and I think you have the condition
inverted, _setargv() worked for decades, and only was broken in the more
recent MSVC's.

My thought is to unilaterally change this to the unicode implementation,
because 1. ANSI-only are dead Windows OS's, and 2. Getting the utf-8
thing right in this app is becoming a big headache.

Thoughts?



On Wed, May 25, 2016 at 11:29 AM, <gs...@apache.org> wrote:

> Author: gsmith
> Date: Wed May 25 16:29:59 2016
> New Revision: 1745517
>
> URL: http://svn.apache.org/viewvc?rev=1745517&view=rev
> Log:
> backport r1745516
> _setargv will not compile on _MSC_VER < 1700
> MS documentation's example simply does not work.
> Disabe for now, Apachemonitor still works.
>
> Modified:
>     httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c
>
> Modified: httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c?rev=1745517&r1=1745516&r2=1745517&view=diff
>
> ==============================================================================
> --- httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c (original)
> +++ httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c Wed May 25
> 16:29:59 2016
> @@ -1586,8 +1586,10 @@ int WINAPI WinMain(HINSTANCE hInstance,
>  #ifdef UNICODE
>      __wargv = CommandLineToArgvW(GetCommandLineW(), &__argc);
>  #else
> +#if defined(_MSC_VER) && _MSC_VER < 1800
>      _setargv();
>  #endif
> +#endif
>
>      if ((__argc == 2) && (_tcscmp(__targv[1], _T("--kill")) == 0))
>      {
>
>
>

Re: svn commit: r1745517 - /httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c

Posted by William A Rowe Jr <wr...@rowe-clan.net>.
On Wed, May 25, 2016 at 1:14 PM, William A Rowe Jr <wr...@rowe-clan.net>
wrote:

> Your comment doesn't match the code, and I think you have the condition
> inverted, _setargv() worked for decades, and only was broken in the more
> recent MSVC's.
>

Correction, the code looks right (sort of, I believe you might have broken
the
command line invocation to halt ApacheMonitor.exe to allow for it to be
upgraded
or replaced, and perhaps to re-invoke itself as Admin.)  The commit log
message
seems inverted.

Re: svn commit: r1745517 - /httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c

Posted by Gregg Smith <gl...@gknw.net>.
On 5/25/2016 11:14 AM, William A Rowe Jr wrote:
> Your comment doesn't match the code, and I think you have the condition
> inverted, _setargv() worked for decades, and only was broken in the more
> recent MSVC's.

Typo, should be 1800 in log, I'll change it. I may revert it now that I 
dug & found $(VCINSTALLDIR) . If that's in VC6 then it's usable all the 
way up the line and the setargv.obj can just be added to the dsp/mak files.

> My thought is to unilaterally change this to the unicode implementation,
> because 1. ANSI-only are dead Windows OS's, and 2. Getting the utf-8
> thing right in this app is becoming a big headache.
>
> Thoughts?

If it deals with this then why not!
Apachemonitor itself could use another way of figuring out what it's 
running on also as GetVersionExA is gone and the code in VC > 11 making 
it work won't last forever I'd suspect. I've been looking into that and 
MS gives an nice example at 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms725491%28v=vs.85%29.aspx


> On Wed, May 25, 2016 at 11:29 AM,<gs...@apache.org>  wrote:
>
>> Author: gsmith
>> Date: Wed May 25 16:29:59 2016
>> New Revision: 1745517
>>
>> URL: http://svn.apache.org/viewvc?rev=1745517&view=rev
>> Log:
>> backport r1745516
>> _setargv will not compile on _MSC_VER<  1700
>> MS documentation's example simply does not work.
>> Disabe for now, Apachemonitor still works.
>>
>> Modified:
>>      httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c
>>
>> Modified: httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c
>> URL:
>> http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c?rev=1745517&r1=1745516&r2=1745517&view=diff
>>
>> ==============================================================================
>> --- httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c (original)
>> +++ httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c Wed May 25
>> 16:29:59 2016
>> @@ -1586,8 +1586,10 @@ int WINAPI WinMain(HINSTANCE hInstance,
>>   #ifdef UNICODE
>>       __wargv = CommandLineToArgvW(GetCommandLineW(),&__argc);
>>   #else
>> +#if defined(_MSC_VER)&&  _MSC_VER<  1800
>>       _setargv();
>>   #endif
>> +#endif
>>
>>       if ((__argc == 2)&&  (_tcscmp(__targv[1], _T("--kill")) == 0))
>>       {
>>
>>
>>