summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/com_com.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-12-06 17:31:40 (GMT)
committerWez Furlong <wez@php.net>2003-12-06 17:31:40 (GMT)
commit59823eca66ff76a66baf4f0a903e01d6ef7c48e3 (patch)
tree8a648fda349789eadf3ee27f0119829ffc2dc587 /ext/com_dotnet/com_com.c
parentdf137ad240015f04a7b79b00b8f6bd594a99912f (diff)
downloadphp-59823eca66ff76a66baf4f0a903e01d6ef7c48e3.tar.gz
com_create_guid() returns...
Diffstat (limited to 'ext/com_dotnet/com_com.c')
-rw-r--r--ext/com_dotnet/com_com.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 5484161..9183a01 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;
+ }
+}
+