mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-06 16:08:43 +02:00
Fix up a bunch of details in the docs.
2007-12-12 Alexander Larsson <alexl@redhat.com> * gappinfo.[ch]: * gasyncresult.c: * gbufferedinputstream.c: * gbufferedoutputstream.c: * gcancellable.c: * gcontenttype.c: * gdatainputstream.[ch]: * gdesktopappinfo.c: * gdirectorymonitor.c: * gfile.[ch]: * gfileattribute.[ch]: * gfileicon.[ch]: * gfileinfo.h: * gfileinputstream.h: * gfilemonitor.[ch]: * gfileoutputstream.[ch]: * gfilterinputstream.h: * gfilteroutputstream.h: * gicon.h: * gioscheduler.c: * gloadableicon.[ch]: * gmemoryinputstream.c: * gmountoperation.c: * gthemedicon.c: Fix up a bunch of details in the docs. * glocalfileinfo.c: CR/LF -> LF fixups svn path=/trunk/; revision=6100
This commit is contained in:
committed by
Alexander Larsson
parent
2de9f839a0
commit
41d1650c9b
@@ -1288,70 +1288,70 @@ win32_get_file_user_info (const gchar* filename,
|
||||
sd_size,
|
||||
&sd_size))
|
||||
{
|
||||
PSID psid = 0;
|
||||
PSID psid = 0;
|
||||
BOOL defaulted;
|
||||
SID_NAME_USE name_use = 0; /* don't care? */
|
||||
wchar_t *name = NULL;
|
||||
wchar_t *domain = NULL;
|
||||
DWORD name_len = 0;
|
||||
DWORD domain_len = 0;
|
||||
/* get the user name */
|
||||
do {
|
||||
if (!user_name)
|
||||
break;
|
||||
if (!GetSecurityDescriptorOwner (psd, &psid, &defaulted))
|
||||
break;
|
||||
if (!LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
name, &name_len,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use) && (ERROR_INSUFFICIENT_BUFFER != GetLastError()))
|
||||
break;
|
||||
name = g_try_malloc (name_len*sizeof(wchar_t));
|
||||
domain = g_try_malloc (domain_len*sizeof(wchar_t));
|
||||
if (name && domain &&
|
||||
LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
name, &name_len,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use))
|
||||
{
|
||||
*user_name = g_utf16_to_utf8 (name, -1, NULL, NULL, NULL);
|
||||
}
|
||||
g_free (name);
|
||||
g_free (domain);
|
||||
} while (FALSE);
|
||||
|
||||
/* get the group name */
|
||||
do {
|
||||
if (!group_name)
|
||||
break;
|
||||
if (!GetSecurityDescriptorGroup (psd, &psid, &defaulted))
|
||||
break;
|
||||
if (!LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
name, &name_len,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use) && (ERROR_INSUFFICIENT_BUFFER != GetLastError()))
|
||||
break;
|
||||
name = g_try_malloc (name_len*sizeof(wchar_t));
|
||||
domain = g_try_malloc (domain_len*sizeof(wchar_t));
|
||||
if (name && domain &&
|
||||
LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
name, &name_len,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use))
|
||||
{
|
||||
*group_name = g_utf16_to_utf8 (name, -1, NULL, NULL, NULL);
|
||||
}
|
||||
g_free (name);
|
||||
g_free (domain);
|
||||
} while (FALSE);
|
||||
|
||||
/* TODO: get real name */
|
||||
|
||||
g_free (psd);
|
||||
wchar_t *name = NULL;
|
||||
wchar_t *domain = NULL;
|
||||
DWORD name_len = 0;
|
||||
DWORD domain_len = 0;
|
||||
/* get the user name */
|
||||
do {
|
||||
if (!user_name)
|
||||
break;
|
||||
if (!GetSecurityDescriptorOwner (psd, &psid, &defaulted))
|
||||
break;
|
||||
if (!LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
name, &name_len,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use) && (ERROR_INSUFFICIENT_BUFFER != GetLastError()))
|
||||
break;
|
||||
name = g_try_malloc (name_len*sizeof(wchar_t));
|
||||
domain = g_try_malloc (domain_len*sizeof(wchar_t));
|
||||
if (name && domain &&
|
||||
LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
name, &name_len,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use))
|
||||
{
|
||||
*user_name = g_utf16_to_utf8 (name, -1, NULL, NULL, NULL);
|
||||
}
|
||||
g_free (name);
|
||||
g_free (domain);
|
||||
} while (FALSE);
|
||||
|
||||
/* get the group name */
|
||||
do {
|
||||
if (!group_name)
|
||||
break;
|
||||
if (!GetSecurityDescriptorGroup (psd, &psid, &defaulted))
|
||||
break;
|
||||
if (!LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
name, &name_len,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use) && (ERROR_INSUFFICIENT_BUFFER != GetLastError()))
|
||||
break;
|
||||
name = g_try_malloc (name_len*sizeof(wchar_t));
|
||||
domain = g_try_malloc (domain_len*sizeof(wchar_t));
|
||||
if (name && domain &&
|
||||
LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
name, &name_len,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use))
|
||||
{
|
||||
*group_name = g_utf16_to_utf8 (name, -1, NULL, NULL, NULL);
|
||||
}
|
||||
g_free (name);
|
||||
g_free (domain);
|
||||
} while (FALSE);
|
||||
|
||||
/* TODO: get real name */
|
||||
|
||||
g_free (psd);
|
||||
}
|
||||
g_free (wfilename);
|
||||
}
|
||||
|
Reference in New Issue
Block a user