static ZEND_FUNCTION(com_indexed_prop_set);
+static ZEND_FUNCTION(com_create_guid);
/* protos */
static int com_hash(rpc_string, rpc_string *, void *, int, char *, int);
ZEND_FE(com_load_typelib, NULL)
ZEND_FE(com_print_typeinfo, NULL)
ZEND_FE(com_indexed_prop_set, NULL)
+ ZEND_FE(com_create_guid, NULL)
RPC_FUNCTION_ENTRY_END()
zend_module_entry com_module_entry = {
/* custom functions */
+static ZEND_FUNCTION(com_create_guid)
+{
+ GUID retval;
+ OLECHAR *guid_string;
+
+ if (ZEND_NUM_ARGS() != 0) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ if (CoCreateGuid(&retval) && StringFromCLSID(&retval, &guid_string)) {
+ Z_TYPE_P(return_value) = IS_STRING;
+ Z_STRVAL_P(return_value) = php_OLECHAR_to_char(guid_string, &Z_STRLEN_P(return_value), CP_ACP, 0);
+
+ CoTaskMemFree(guid_string);
+ } else {
+ RETURN_FALSE;
+ }
+}
+
+
+
static ZEND_FUNCTION(com_indexed_prop_set)
{
zval *object;
efree((v));
#define ZVAL_VARIANT(z, v, cp) \
+ if (V_VT(v) == VT_DISPATCH && V_DISPATCH(v) == NULL) { \
+ V_VT(v) = VT_NULL; \
+ } \
if (V_VT(v) == VT_DISPATCH) { \
comval *obj; \
ALLOC_COM(obj); \