summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-12-06 17:31:40 +0000
committerWez Furlong <wez@php.net>2003-12-06 17:31:40 +0000
commit59823eca66ff76a66baf4f0a903e01d6ef7c48e3 (patch)
tree8a648fda349789eadf3ee27f0119829ffc2dc587 /ext
parentdf137ad240015f04a7b79b00b8f6bd594a99912f (diff)
downloadphp-git-59823eca66ff76a66baf4f0a903e01d6ef7c48e3.tar.gz
com_create_guid() returns...
Diffstat (limited to 'ext')
-rw-r--r--ext/com_dotnet/com_com.c20
-rw-r--r--ext/com_dotnet/com_extension.c1
-rw-r--r--ext/com_dotnet/php_com_dotnet.h2
3 files changed, 22 insertions, 1 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 5484161712..9183a013a0 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -441,3 +441,23 @@ int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen,
return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args TSRMLS_CC);
}
+
+PHP_FUNCTION(com_create_guid)
+{
+ GUID retval;
+ OLECHAR *guid_string;
+
+ if (ZEND_NUM_ARGS() != 0) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) {
+ Z_TYPE_P(return_value) = IS_STRING;
+ Z_STRVAL_P(return_value) = php_com_olestring_to_string(guid_string, &Z_STRLEN_P(return_value), CP_ACP, 0);
+
+ CoTaskMemFree(guid_string);
+ } else {
+ RETURN_FALSE;
+ }
+}
+
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index ec155ead19..7ff7dbb0c4 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -60,6 +60,7 @@ function_entry com_dotnet_functions[] = {
PHP_FE(variant_get_type, NULL)
PHP_FE(variant_set_type, NULL)
PHP_FE(variant_cast, NULL)
+ PHP_FE(com_create_guid, NULL)
{ NULL, NULL, NULL }
};
diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h
index 5d29c52594..831c7ad3c0 100644
--- a/ext/com_dotnet/php_com_dotnet.h
+++ b/ext/com_dotnet/php_com_dotnet.h
@@ -40,7 +40,7 @@ PHP_RINIT_FUNCTION(com_dotnet);
PHP_RSHUTDOWN_FUNCTION(com_dotnet);
PHP_MINFO_FUNCTION(com_dotnet);
-PHP_FUNCTION(confirm_com_dotnet_compiled);
+PHP_FUNCTION(com_create_guid);
ZEND_BEGIN_MODULE_GLOBALS(com_dotnet)
zend_bool allow_dcom;