Win32 port

Peter Kümmel syntheticpp at gmx.net
Sun Jun 25 14:26:33 PDT 2006


I forgot one important line:

+static DBusHashTable *win32_sids = NULL;

> 
> Index: dbus/dbus-sysdeps.c
> ===================================================================
> RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.c,v
> retrieving revision 1.102
> diff -u -b -B -r1.102 dbus-sysdeps.c
> --- dbus/dbus-sysdeps.c    30 May 2006 15:34:10 -0000    1.102
> +++ dbus/dbus-sysdeps.c    22 Jun 2006 11:39:20 -0000
> 
> +/**
> + * Returns the textual form of a SID. The return value points
> + * to statically allocated memory and should not be freed.
> + *
> + * @param psid pointer to the SID
> + */
> +dbus_uid_t
> +_dbus_win32_sid_to_uid_t (void *psid)
> +{
> +  dbus_uid_t retval;
> +  char *string, *oldval;
> +
> +  if (!IsValidSid ((PSID) psid)) {
> +   _dbus_verbose("%s invalid sid\n",__FUNCTION__);
> +    return "-";
> +    }
> +  if (!ConvertSidToStringSidA ((PSID) psid, &string)) {
> +    _dbus_verbose("%s invalid sid\n",__FUNCTION__);
> +    return "-";
> +  }
> +
> +  _DBUS_LOCK (win32_sids);
> +
> +  if (win32_sids == NULL)
> +    {
> +      win32_sids = _dbus_hash_table_new (DBUS_HASH_STRING, NULL, NULL);
> +      _dbus_register_shutdown_func (sid_cache_shutdown, NULL);
> +    }
> +
> +  oldval = _dbus_hash_table_lookup_string (win32_sids, string);
> +
> +  if (oldval)
> +    {
> +      _dbus_verbose("%s sid %s found in cache\n",__FUNCTION__,oldval);
> +      LocalFree (string);
> +      retval = oldval;
> +    }
> +  else
> +    {
> +      _dbus_hash_table_insert_string (win32_sids, string, string);
> +      _dbus_verbose("%s sid %s added to cache\n",__FUNCTION__,string);
> +      retval = string;
> +    }
> +
> +  _DBUS_UNLOCK (win32_sids);
> +
> +  return retval;
> +}
> +
> +#endif
> +
>  /** @} end of sysdeps */
> 
>  /* tests in dbus-sysdeps-util.c */
> 
>  /** @} end of sysdeps */
> 
>  /* tests in dbus-sysdeps-util.c */
> 



More information about the dbus mailing list