1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
This commit is contained in:
Harald Radi
2002-04-27 10:28:52 +00:00
parent a47cc80ad9
commit 568e301e46
4 changed files with 14 additions and 24 deletions
+5 -9
View File
@@ -133,6 +133,7 @@ PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DIS
if (FAILED(hr)) {
switch (hr) {
case DISP_E_EXCEPTION: {
char *src=estrdup("Unavailable");
int srclen=strlen(src);
char *desc=estrdup("Unavailable");
@@ -500,14 +501,11 @@ PHP_FUNCTION(com_load)
}
if (server_name != NULL) {
/* if a server is passed, one obviously wants to instanciate a
* remote server
*/
flags = CLSCTX_REMOTE_SERVER;
/* What is server name? A String or an array? */
if (Z_TYPE_P(server_name) == IS_ARRAY) {
if (Z_TYPE_P(server_name) == IS_NULL) {
server_name = NULL;
} else if (Z_TYPE_P(server_name) == IS_ARRAY) {
pval **tmp;
/* DAB: 22 Sept 2001 */
/* Aha - we have a number of possible */
@@ -567,14 +565,12 @@ PHP_FUNCTION(com_load)
convert_to_long_ex(tmp);
flags = (CLSCTX) Z_LVAL_PP(tmp);
}
}
if (Z_TYPE_P(server_name) == IS_NULL) {
server_name = NULL;
} else {
if (!INI_INT("com.allow_dcom")) {
php_error(E_WARNING, "DCOM is disabled");
RETURN_FALSE;
} else {
flags = CLSCTX_REMOTE_SERVER;
convert_to_string_ex(&server_name);
}
}
+2 -3
View File
@@ -30,8 +30,7 @@ END_EXTERN_C()
ALLOC_HASHTABLE(properties); \
zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
\
ALLOC_ZVAL(handle); \
INIT_PZVAL(handle); \
MAKE_STD_ZVAL(handle); \
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
\
zval_copy_ctor(handle); \
@@ -46,7 +45,7 @@ END_EXTERN_C()
#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \
C_REFCOUNT(z) = 0;
#define FREE_COM(z) efree(z);
#define FREE_COM(z) php_COM_destruct(z TSRMLS_CC);
#define IS_COM php_COM_get_le_comval()
+5 -9
View File
@@ -133,6 +133,7 @@ PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DIS
if (FAILED(hr)) {
switch (hr) {
case DISP_E_EXCEPTION: {
char *src=estrdup("Unavailable");
int srclen=strlen(src);
char *desc=estrdup("Unavailable");
@@ -500,14 +501,11 @@ PHP_FUNCTION(com_load)
}
if (server_name != NULL) {
/* if a server is passed, one obviously wants to instanciate a
* remote server
*/
flags = CLSCTX_REMOTE_SERVER;
/* What is server name? A String or an array? */
if (Z_TYPE_P(server_name) == IS_ARRAY) {
if (Z_TYPE_P(server_name) == IS_NULL) {
server_name = NULL;
} else if (Z_TYPE_P(server_name) == IS_ARRAY) {
pval **tmp;
/* DAB: 22 Sept 2001 */
/* Aha - we have a number of possible */
@@ -567,14 +565,12 @@ PHP_FUNCTION(com_load)
convert_to_long_ex(tmp);
flags = (CLSCTX) Z_LVAL_PP(tmp);
}
}
if (Z_TYPE_P(server_name) == IS_NULL) {
server_name = NULL;
} else {
if (!INI_INT("com.allow_dcom")) {
php_error(E_WARNING, "DCOM is disabled");
RETURN_FALSE;
} else {
flags = CLSCTX_REMOTE_SERVER;
convert_to_string_ex(&server_name);
}
}
+2 -3
View File
@@ -30,8 +30,7 @@ END_EXTERN_C()
ALLOC_HASHTABLE(properties); \
zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
\
ALLOC_ZVAL(handle); \
INIT_PZVAL(handle); \
MAKE_STD_ZVAL(handle); \
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
\
zval_copy_ctor(handle); \
@@ -46,7 +45,7 @@ END_EXTERN_C()
#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \
C_REFCOUNT(z) = 0;
#define FREE_COM(z) efree(z);
#define FREE_COM(z) php_COM_destruct(z TSRMLS_CC);
#define IS_COM php_COM_get_le_comval()