Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8ae81d06
Commit
8ae81d06
authored
Nov 30, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Dec 01, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Set the UserSID property.
parent
19a49eb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
package.c
dlls/msi/package.c
+54
-0
No files found.
dlls/msi/package.c
View file @
8ae81d06
...
...
@@ -41,6 +41,7 @@
#include "wine/unicode.h"
#include "objbase.h"
#include "msidefs.h"
#include "sddl.h"
#include "msipriv.h"
...
...
@@ -113,6 +114,56 @@ static UINT set_installed_prop( MSIPACKAGE *package )
return
r
;
}
static
UINT
set_user_sid_prop
(
MSIPACKAGE
*
package
)
{
SID_NAME_USE
use
;
LPWSTR
user_name
;
LPWSTR
sid_str
,
dom
=
NULL
;
DWORD
size
,
dom_size
;
PSID
psid
=
NULL
;
UINT
r
=
ERROR_FUNCTION_FAILED
;
static
const
WCHAR
user_sid
[]
=
{
'U'
,
's'
,
'e'
,
'r'
,
'S'
,
'I'
,
'D'
,
0
};
size
=
0
;
GetUserNameW
(
NULL
,
&
size
);
user_name
=
msi_alloc
(
(
size
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
user_name
)
return
ERROR_OUTOFMEMORY
;
if
(
!
GetUserNameW
(
user_name
,
&
size
))
goto
done
;
size
=
0
;
dom_size
=
0
;
LookupAccountNameW
(
NULL
,
user_name
,
NULL
,
&
size
,
NULL
,
&
dom_size
,
&
use
);
psid
=
msi_alloc
(
size
);
dom
=
msi_alloc
(
dom_size
);
if
(
!
psid
||
!
dom
)
{
r
=
ERROR_OUTOFMEMORY
;
goto
done
;
}
if
(
!
LookupAccountNameW
(
NULL
,
user_name
,
psid
,
&
size
,
dom
,
&
dom_size
,
&
use
))
goto
done
;
if
(
!
ConvertSidToStringSidW
(
psid
,
&
sid_str
))
goto
done
;
r
=
MSI_SetPropertyW
(
package
,
user_sid
,
sid_str
);
done:
LocalFree
(
sid_str
);
msi_free
(
dom
);
msi_free
(
psid
);
msi_free
(
user_name
);
return
r
;
}
/*
* There are a whole slew of these we need to set
*
...
...
@@ -379,6 +430,9 @@ static VOID set_installer_properties(MSIPACKAGE *package)
msi_free
(
company
);
}
if
(
set_user_sid_prop
(
package
)
!=
ERROR_SUCCESS
)
ERR
(
"Failed to set the UserSID property
\n
"
);
msi_free
(
check
);
CloseHandle
(
hkey
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment