summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Radi <phanto@php.net>2001-07-18 19:40:38 +0000
committerHarald Radi <phanto@php.net>2001-07-18 19:40:38 +0000
commit503ac7cf27a745a512b6059a80d6b0346629cbbd (patch)
tree8aaab31ace2a462a8f23bb72184dbe5f270c5d9c
parentc4f9121eb7d24670f683ac948a55c99ab5007794 (diff)
downloadphp-git-503ac7cf27a745a512b6059a80d6b0346629cbbd.tar.gz
MFH and VT_DATE patch
-rw-r--r--ext/com/COM.c15
-rw-r--r--ext/com/conversion.c19
-rw-r--r--ext/rpc/com/com_wrapper.c15
-rw-r--r--ext/rpc/com/conversion.c19
4 files changed, 34 insertions, 34 deletions
diff --git a/ext/com/COM.c b/ext/com/COM.c
index a725909eca..3431bc5754 100644
--- a/ext/com/COM.c
+++ b/ext/com/COM.c
@@ -370,26 +370,21 @@ static PHP_INI_MH(OnTypelibFileChange)
FILE *typelib_file;
char *typelib_name_buffer;
char *strtok_buf = NULL;
-#if SUPPORT_INTERACTIVE
int interactive;
- ELS_FETCH();
-
- interactive = EG(interactive);
-#endif
+ CLS_FETCH();
+ interactive = CG(interactive);
if(!new_value || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL)
{
return FAILURE;
}
-#if SUPPORT_INTERACTIVE
if(interactive)
{
printf("Loading type libraries...");
fflush(stdout);
}
-#endif
typelib_name_buffer = (char *) emalloc(sizeof(char)*1024);
@@ -431,13 +426,11 @@ static PHP_INI_MH(OnTypelibFileChange)
ptr--;
}
-
-#if SUPPORT_INTERACTIVE
if(interactive)
{
printf("\rLoading %-60s\r", typelib_name);
}
-#endif
+
if((pTL = php_COM_find_typelib(typelib_name, mode)) != NULL)
{
php_COM_load_typelib(pTL, mode);
@@ -448,12 +441,10 @@ static PHP_INI_MH(OnTypelibFileChange)
efree(typelib_name_buffer);
fclose(typelib_file);
-#if SUPPORT_INTERACTIVE
if(interactive)
{
printf("\r%70s\r", "");
}
-#endif
return SUCCESS;
}
diff --git a/ext/com/conversion.c b/ext/com/conversion.c
index eb0e25d084..9e8ee43417 100644
--- a/ext/com/conversion.c
+++ b/ext/com/conversion.c
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Author: Harald Radi <h.radi@nme.at> |
- | Alan Brown <abrown@pobox.com> |
+ | Author: Harald Radi <h.radi@nme.at> |
+ | Alan Brown <abrown@pobox.com> |
| Paul Shortis <pshortis@dataworx.com.au> |
+----------------------------------------------------------------------+
*/
@@ -241,6 +241,7 @@ PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_
struct tm *phptime;
phptime = gmtime(&(pval_arg->value.lval));
+ memset(&wintime, 0, sizeof(wintime));
wintime.wYear = phptime->tm_year + 1900;
wintime.wMonth = phptime->tm_mon + 1;
@@ -251,6 +252,7 @@ PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_
SystemTimeToVariantTime(&wintime, &V_DATE(var_arg));
}
+ break;
case VT_BSTR:
convert_to_string_ex(&pval_arg);
@@ -338,6 +340,7 @@ PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_
struct tm *phptime;
phptime = gmtime(&(pval_arg->value.lval));
+ memset(&wintime, 0, sizeof(wintime));
wintime.wYear = phptime->tm_year + 1900;
wintime.wMonth = phptime->tm_mon + 1;
@@ -348,6 +351,7 @@ PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_
SystemTimeToVariantTime(&wintime, var_arg->pdate);
}
+ break;
case VT_BSTR|VT_BYREF:
convert_to_string(pval_arg);
@@ -472,7 +476,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
if (1 != (Dims = SafeArrayGetDim(array)))
{
php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims);
- ZVAL_FALSE(pval_arg);
+ ZVAL_NULL(pval_arg);
return FAILURE;
}
SafeArrayLock( array);
@@ -551,7 +555,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
else switch(var_arg->vt & ~VT_BYREF)
{
case VT_EMPTY:
- var_uninit(pval_arg);
+ ZVAL_NULL(pval_arg);
break;
case VT_UI1:
@@ -666,10 +670,13 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
if(V_ISBYREF(var_arg))
{
Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(*V_BSTRREF(var_arg), &Z_STRLEN_P(pval_arg), persistent, codepage);
+ SysFreeString(*V_BSTRREF(var_arg));
+ efree(V_BSTRREF(var_arg));
}
else
{
Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(V_BSTR(var_arg), &Z_STRLEN_P(pval_arg), persistent, codepage);
+ SysFreeString(V_BSTR(var_arg));
}
Z_TYPE_P(pval_arg) = IS_STRING;
@@ -689,6 +696,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
VariantTimeToSystemTime(V_DATE(var_arg), &wintime);
}
+ memset(&phptime, 0, sizeof(phptime));
+
phptime.tm_year = wintime.wYear - 1900;
phptime.tm_mon = wintime.wMonth - 1;
phptime.tm_mday = wintime.wDay;
@@ -737,7 +746,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
else
{
ALLOC_COM(obj);
- php_COM_set(obj, V_DISPATCH(var_arg), FALSE);
+ php_COM_set(obj, V_DISPATCH(var_arg), TRUE);
ZVAL_COM(pval_arg, obj);
}
diff --git a/ext/rpc/com/com_wrapper.c b/ext/rpc/com/com_wrapper.c
index a725909eca..3431bc5754 100644
--- a/ext/rpc/com/com_wrapper.c
+++ b/ext/rpc/com/com_wrapper.c
@@ -370,26 +370,21 @@ static PHP_INI_MH(OnTypelibFileChange)
FILE *typelib_file;
char *typelib_name_buffer;
char *strtok_buf = NULL;
-#if SUPPORT_INTERACTIVE
int interactive;
- ELS_FETCH();
-
- interactive = EG(interactive);
-#endif
+ CLS_FETCH();
+ interactive = CG(interactive);
if(!new_value || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL)
{
return FAILURE;
}
-#if SUPPORT_INTERACTIVE
if(interactive)
{
printf("Loading type libraries...");
fflush(stdout);
}
-#endif
typelib_name_buffer = (char *) emalloc(sizeof(char)*1024);
@@ -431,13 +426,11 @@ static PHP_INI_MH(OnTypelibFileChange)
ptr--;
}
-
-#if SUPPORT_INTERACTIVE
if(interactive)
{
printf("\rLoading %-60s\r", typelib_name);
}
-#endif
+
if((pTL = php_COM_find_typelib(typelib_name, mode)) != NULL)
{
php_COM_load_typelib(pTL, mode);
@@ -448,12 +441,10 @@ static PHP_INI_MH(OnTypelibFileChange)
efree(typelib_name_buffer);
fclose(typelib_file);
-#if SUPPORT_INTERACTIVE
if(interactive)
{
printf("\r%70s\r", "");
}
-#endif
return SUCCESS;
}
diff --git a/ext/rpc/com/conversion.c b/ext/rpc/com/conversion.c
index eb0e25d084..9e8ee43417 100644
--- a/ext/rpc/com/conversion.c
+++ b/ext/rpc/com/conversion.c
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Author: Harald Radi <h.radi@nme.at> |
- | Alan Brown <abrown@pobox.com> |
+ | Author: Harald Radi <h.radi@nme.at> |
+ | Alan Brown <abrown@pobox.com> |
| Paul Shortis <pshortis@dataworx.com.au> |
+----------------------------------------------------------------------+
*/
@@ -241,6 +241,7 @@ PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_
struct tm *phptime;
phptime = gmtime(&(pval_arg->value.lval));
+ memset(&wintime, 0, sizeof(wintime));
wintime.wYear = phptime->tm_year + 1900;
wintime.wMonth = phptime->tm_mon + 1;
@@ -251,6 +252,7 @@ PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_
SystemTimeToVariantTime(&wintime, &V_DATE(var_arg));
}
+ break;
case VT_BSTR:
convert_to_string_ex(&pval_arg);
@@ -338,6 +340,7 @@ PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_
struct tm *phptime;
phptime = gmtime(&(pval_arg->value.lval));
+ memset(&wintime, 0, sizeof(wintime));
wintime.wYear = phptime->tm_year + 1900;
wintime.wMonth = phptime->tm_mon + 1;
@@ -348,6 +351,7 @@ PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_
SystemTimeToVariantTime(&wintime, var_arg->pdate);
}
+ break;
case VT_BSTR|VT_BYREF:
convert_to_string(pval_arg);
@@ -472,7 +476,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
if (1 != (Dims = SafeArrayGetDim(array)))
{
php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims);
- ZVAL_FALSE(pval_arg);
+ ZVAL_NULL(pval_arg);
return FAILURE;
}
SafeArrayLock( array);
@@ -551,7 +555,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
else switch(var_arg->vt & ~VT_BYREF)
{
case VT_EMPTY:
- var_uninit(pval_arg);
+ ZVAL_NULL(pval_arg);
break;
case VT_UI1:
@@ -666,10 +670,13 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
if(V_ISBYREF(var_arg))
{
Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(*V_BSTRREF(var_arg), &Z_STRLEN_P(pval_arg), persistent, codepage);
+ SysFreeString(*V_BSTRREF(var_arg));
+ efree(V_BSTRREF(var_arg));
}
else
{
Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(V_BSTR(var_arg), &Z_STRLEN_P(pval_arg), persistent, codepage);
+ SysFreeString(V_BSTR(var_arg));
}
Z_TYPE_P(pval_arg) = IS_STRING;
@@ -689,6 +696,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
VariantTimeToSystemTime(V_DATE(var_arg), &wintime);
}
+ memset(&phptime, 0, sizeof(phptime));
+
phptime.tm_year = wintime.wYear - 1900;
phptime.tm_mon = wintime.wMonth - 1;
phptime.tm_mday = wintime.wDay;
@@ -737,7 +746,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
else
{
ALLOC_COM(obj);
- php_COM_set(obj, V_DISPATCH(var_arg), FALSE);
+ php_COM_set(obj, V_DISPATCH(var_arg), TRUE);
ZVAL_COM(pval_arg, obj);
}