Commit Graph

496 Commits

Author SHA1 Message Date
Max Semenik
56f90492d6 Migrate skip checks to --EXTENSIONS--, p1
For rationale, see https://github.com/php/php-src/pull/6787

Extensions migrated in this part:
* bcmath
* bz2
* calendar
* com_dotnet
* ctype

Closes GH-6797.
2021-03-22 17:51:02 +01:00
George Peter Banyard
a74e248c43 Use zend_string_equals() API instead of strcmp() in COM extension 2021-03-17 16:36:16 +00:00
Máté Kocsis
4c6533c257
Generate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip, Zend
Closes GH-6706
2021-02-22 15:24:03 +01:00
Christoph M. Becker
062a891be7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add missing stub for com_exception
2021-01-24 16:07:34 +01:00
Christoph M. Becker
bff7761653 Add missing stub for com_exception 2021-01-24 16:06:49 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Christoph M. Becker
807775b641 Fix COMPersistHelper::__construct() stub
`$variant` is optional.
2020-11-24 00:23:29 +01:00
Christoph M. Becker
a08a2b48b4 Strip trailing line breaks and periods from Windows error messages
PHP error messages should not contain line breaks, so we remove these
from the Windows specific error messages.  We also remove trailing
periods for the same reason.

Closes GH-6423.
2020-11-12 16:42:28 +01:00
Christoph M. Becker
2da00fadc8 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #62474: com_event_sink crashes on certain arguments
2020-10-26 11:55:29 +01:00
Christoph M. Becker
f9ba2ca136 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #62474: com_event_sink crashes on certain arguments
2020-10-26 11:54:45 +01:00
Christoph M. Becker
7424bfc7ac Fix #62474: com_event_sink crashes on certain arguments
We have to make sure that the variant is of type `VT_DISPATCH` before
we access it as such.

Closes GH-6372.
2020-10-26 11:48:57 +01:00
Christoph M. Becker
561b581947 Update ext/com_dotnet parameter names
Closes GH-6296.
2020-10-08 11:45:53 +02:00
George Peter Banyard
e55f0c796c Promote warnings to Error in COM extension
Closes GH-6141
2020-09-21 14:32:00 +01:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Máté Kocsis
c98d47696f
Consolidate new union type ZPP macro names
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112
2020-09-11 11:00:18 +02:00
Máté Kocsis
f7fbc6333f
Add more precise type info for stubs
Closes GH-6005
2020-09-01 16:35:56 +02:00
Christoph M. Becker
d4d52ba945 Prevent com::__construct() to modify the $server_name array
We switch to `zend_string`s for simplicity, so there's no need to
`convert_to_string()` anymore, what makes the array separation
superfluous.

Closes GH-6040
2020-08-31 17:44:27 +02:00
Christoph M. Becker
f956434df2 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Catch potential exceptions during to string conversion
2020-08-27 10:26:15 +02:00
Christoph M. Becker
296030119c Catch potential exceptions during to string conversion
As of PHP 7.4.0, exceptions are allowed to be thrown from inside
`__toString()` methods; we have to cater to that, and catch these
exceptions early.

Closes GH-6042
2020-08-27 10:23:18 +02:00
Christoph M. Becker
00edc3f4bc Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix com_safearray_proxy related memory management issues
2020-08-26 15:43:43 +02:00
Christoph M. Becker
8e2f219fad Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix com_safearray_proxy related memory management issues
2020-08-26 15:40:57 +02:00
Christoph M. Becker
1b7ee6db88 Fix com_safearray_proxy related memory management issues 2020-08-26 15:39:32 +02:00
Christoph M. Becker
2f9e9d4d97 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Separate COM::__construct()s $server_name array
2020-08-26 15:02:34 +02:00
Christoph M. Becker
b087bd2404 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Separate COM::__construct()s $server_name array
2020-08-26 15:01:22 +02:00
Christoph M. Becker
75ac3f1cba Separate COM::__construct()s $server_name array
This may otherwise be modified.
2020-08-26 15:00:02 +02:00
Christoph M. Becker
fc4a6cda4b Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #64130: COM obj parameters passed by reference are not updated
2020-08-26 14:55:34 +02:00
Christoph M. Becker
1ff981d7a6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64130: COM obj parameters passed by reference are not updated
2020-08-26 14:53:46 +02:00
Christoph M. Becker
5ff15e2651 Fix #64130: COM obj parameters passed by reference are not updated
`ITypeInfo_GetIDsOfNames()` is supposed to fail with `E_NOTIMPL` for
out-of-process servers, thus we should not remove the already available
typeinfo of the object in this case.

We also properly free the `byref_vals`.
2020-08-26 14:50:04 +02:00
Christoph M. Becker
7e5ed818a4 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Avoid double-free
2020-08-25 13:15:06 +02:00
Christoph M. Becker
923a14626c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Avoid double-free
2020-08-25 13:12:41 +02:00
Christoph M. Becker
3324bb893e Avoid double-free
As of commit b2e3fd1[1] the `authid.User` is no longer newly allocated,
so we must not free it.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b2e3fd1e691b1dc82aaaf4150461db97bd5acf4a>
2020-08-25 13:11:22 +02:00
Christoph M. Becker
e6044d4455 Fix #55847: DOTNET .NET 4.0 GAC new location
If we do not specify the exact version of the .NET framework to use,
the default CLR is loaded, which is typically CLR 2, which is very old.
Therefore, we introduce a `PHP_INI_SYSTEM` setting, which allows users
to choose the desired .NET framework version.  The value of the setting
are the first three parts of the framework's version number, separated
by dots, and prefixed with "v", e.g. "v4.0.30319".  If the value of the
INI setting is `NULL` (the default) or an empty string, the default CLR
is used.

Internally, we switch from the most generic `CoCreateInstance()` to
`CorBindToRuntime()` which is implemented in mscoree.dll.  To avoid the
hard dependency to that library, we load dynamically.

So this fix is supposed to be fully backwards compatible.

Closes GH-5949
2020-08-22 12:42:34 +02:00
Christoph M. Becker
9e930907df Autogenerate function entries for COMPersistHelper
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2020-08-11 11:42:40 +02:00
Christoph M. Becker
dc5077cc53 Remove practically unused parameter
The `cached` out parameter of `php_com_load_typelib_via_cache()` was
meant to signal whether a particular typelib actually has been cached.
This is not really relevant, though, for the imagined purposes, and
since the parameter is no longer really used, we removed it altohether.
2020-08-11 11:38:43 +02:00
Christoph M. Becker
013dcab344 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #48585: com_load_typelib holds reference, fails on second call
2020-08-11 11:28:41 +02:00
Christoph M. Becker
183b853dc6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #48585: com_load_typelib holds reference, fails on second call
2020-08-11 11:28:07 +02:00
Christoph M. Becker
dc108feab8 Fix #48585: com_load_typelib holds reference, fails on second call
Whether the type library is cached is actually irrelevant here; what
matters is that the symbols are imported, and since these are not
cached, we have to import them for every request.  And we cannot cache
the symbols, because the import depends on the current codepage, but
the codepage is a `PHP_INI_ALL` setting.
2020-08-11 11:26:50 +02:00
Máté Kocsis
046cc5e4c2
Add another round of missing parameter types to stubs
Closes GH-5950
2020-08-07 16:48:45 +02:00
Nikita Popov
8b77c58130 Accept zend_object* in zend_update_property 2020-08-07 16:40:27 +02:00
Nikita Popov
7991fc2753 Accept zend_object in zend_read_property 2020-08-07 16:40:27 +02:00
Máté Kocsis
0d330e1a02
Add a few missing parameter types in stubs
Related to GH-5627
2020-07-30 14:26:45 +02:00
Máté Kocsis
5770b66722
Cleanup argument handling of Zend functions and methods
Closes GH-5847
2020-07-21 14:47:03 +02:00
Christoph M. Becker
05e9197c51 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #63527: DCOM does not work with Username, Password parameter
2020-07-20 14:45:42 +02:00
Christoph M. Becker
4b96a75ffd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #63527: DCOM does not work with Username, Password parameter
2020-07-20 14:44:18 +02:00
Christoph M. Becker
b2e3fd1e69 Fix #63527: DCOM does not work with Username, Password parameter
We must not mix multibyte and wide character strings in the
`COAUTHIDENTITY` structure.  Using wide character strings throughout
would have the advantage that the remote connection can be established
regardless of the code page of the server, but that would more likely
break BC, so we just drop the wide character string conversion of the
username.
2020-07-20 14:43:29 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Nikita Popov
312201dce4 Add get_gc handle for object iterators
Optional handler with the same semantics as the object handler.
2020-07-01 15:17:22 +02:00
Christoph M. Becker
bf6720d582 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #63208: BSTR to PHP string conversion not binary safe
2020-06-29 19:06:56 +02:00
Christoph M. Becker
4af69b8477 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #63208: BSTR to PHP string conversion not binary safe
2020-06-29 19:06:00 +02:00
Christoph M. Becker
a385cfa7ad Fix #63208: BSTR to PHP string conversion not binary safe
A `BSTR` is similar to a `zend_string`; it stores the length of the
string just before the actual string, and thus the string may contain
NUL bytes.  However, `php_com_olestring_to_string()` is supposed to
deal with arbitrary `OLECHAR*`s which may not be `BSTR`s, so we
introduce `php_com_bstr_to_string()` and use it for the only case where
we actually have to deal with `BSTR`s which may contain NUL bytes.

Contrary to `php_com_olestring_to_string()` we return a `zend_string`,
so we can save the re-allocation when converting to a `zval`.

We also cater to `php_com_string_to_olestring()` not being binary safe,
with basically the same fix we did for `php_com_olestring_to_string()`.
2020-06-29 19:05:02 +02:00