Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b0498a76
Commit
b0498a76
authored
Aug 14, 2006
by
Robert Reif
Committed by
Alexandre Julliard
Aug 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Move duplicated code into function.
parent
70071af6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
68 deletions
+43
-68
lsa.c
dlls/advapi32/lsa.c
+43
-68
No files found.
dlls/advapi32/lsa.c
View file @
b0498a76
...
@@ -48,13 +48,52 @@ static void dumpLsaAttributes(PLSA_OBJECT_ATTRIBUTES oa)
...
@@ -48,13 +48,52 @@ static void dumpLsaAttributes(PLSA_OBJECT_ATTRIBUTES oa)
{
{
if
(
oa
)
if
(
oa
)
{
{
TRACE
(
"
\n\t
length=%lu, rootdir=%p, objectname=%s
\n\t
attr=0x%08lx, sid=%
p
qos=%p
\n
"
,
TRACE
(
"
\n\t
length=%lu, rootdir=%p, objectname=%s
\n\t
attr=0x%08lx, sid=%
s
qos=%p
\n
"
,
oa
->
Length
,
oa
->
RootDirectory
,
oa
->
Length
,
oa
->
RootDirectory
,
oa
->
ObjectName
?
debugstr_w
(
oa
->
ObjectName
->
Buffer
)
:
"null"
,
oa
->
ObjectName
?
debugstr_w
(
oa
->
ObjectName
->
Buffer
)
:
"null"
,
oa
->
Attributes
,
oa
->
SecurityDescriptor
,
oa
->
SecurityQualityOfService
);
oa
->
Attributes
,
debugstr_sid
(
oa
->
SecurityDescriptor
),
oa
->
SecurityQualityOfService
);
}
}
}
}
static
void
ADVAPI_GetDomainName
(
UNICODE_STRING
*
name
)
{
HKEY
key
;
BOOL
useDefault
=
TRUE
;
LONG
ret
;
if
((
ret
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"System
\\
CurrentControlSet
\\
Services
\\
VxD
\\
VNETSUP"
,
0
,
KEY_READ
,
&
key
))
==
ERROR_SUCCESS
)
{
DWORD
size
=
0
;
static
const
WCHAR
wg
[]
=
{
'W'
,
'o'
,
'r'
,
'k'
,
'g'
,
'r'
,
'o'
,
'u'
,
'p'
,
0
};
ret
=
RegQueryValueExW
(
key
,
wg
,
NULL
,
NULL
,
NULL
,
&
size
);
if
(
ret
==
ERROR_MORE_DATA
||
ret
==
ERROR_SUCCESS
)
{
name
->
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
((
ret
=
RegQueryValueExW
(
key
,
wg
,
NULL
,
NULL
,
(
LPBYTE
)
name
->
Buffer
,
&
size
))
==
ERROR_SUCCESS
)
{
name
->
Length
=
(
USHORT
)(
size
-
sizeof
(
WCHAR
));
name
->
MaximumLength
=
(
USHORT
)
size
;
useDefault
=
FALSE
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
name
->
Buffer
);
name
->
Buffer
=
NULL
;
}
}
RegCloseKey
(
key
);
}
if
(
useDefault
)
RtlCreateUnicodeStringFromAsciiz
(
name
,
"DOMAIN"
);
}
/******************************************************************************
/******************************************************************************
* LsaAddAccountRights [ADVAPI32.@]
* LsaAddAccountRights [ADVAPI32.@]
*
*
...
@@ -394,40 +433,8 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
...
@@ -394,40 +433,8 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
*/
*/
PPOLICY_PRIMARY_DOMAIN_INFO
pinfo
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
PPOLICY_PRIMARY_DOMAIN_INFO
pinfo
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
POLICY_PRIMARY_DOMAIN_INFO
));
sizeof
(
POLICY_PRIMARY_DOMAIN_INFO
));
HKEY
key
;
BOOL
useDefault
=
TRUE
;
LONG
ret
;
if
((
ret
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"System
\\
CurrentControlSet
\\
Services
\\
VxD
\\
VNETSUP"
,
0
,
KEY_READ
,
&
key
))
==
ERROR_SUCCESS
)
{
DWORD
size
=
0
;
static
const
WCHAR
wg
[]
=
{
'W'
,
'o'
,
'r'
,
'k'
,
'g'
,
'r'
,
'o'
,
'u'
,
'p'
,
0
};
ret
=
RegQueryValueExW
(
key
,
wg
,
NULL
,
NULL
,
NULL
,
&
size
);
if
(
ret
==
ERROR_MORE_DATA
||
ret
==
ERROR_SUCCESS
)
{
pinfo
->
Name
.
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
((
ret
=
RegQueryValueExW
(
key
,
wg
,
NULL
,
NULL
,
ADVAPI_GetDomainName
(
&
pinfo
->
Name
);
(
LPBYTE
)
pinfo
->
Name
.
Buffer
,
&
size
))
==
ERROR_SUCCESS
)
{
pinfo
->
Name
.
Length
=
(
USHORT
)(
size
-
sizeof
(
WCHAR
));
pinfo
->
Name
.
MaximumLength
=
(
USHORT
)
size
;
useDefault
=
FALSE
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
pinfo
->
Name
.
Buffer
);
pinfo
->
Name
.
Buffer
=
NULL
;
}
}
RegCloseKey
(
key
);
}
if
(
useDefault
)
RtlCreateUnicodeStringFromAsciiz
(
&
(
pinfo
->
Name
),
"DOMAIN"
);
TRACE
(
"setting domain to %s
\n
"
,
debugstr_w
(
pinfo
->
Name
.
Buffer
));
TRACE
(
"setting domain to %s
\n
"
,
debugstr_w
(
pinfo
->
Name
.
Buffer
));
...
@@ -482,40 +489,8 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
...
@@ -482,40 +489,8 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
*/
*/
PPOLICY_DNS_DOMAIN_INFO
pinfo
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
PPOLICY_DNS_DOMAIN_INFO
pinfo
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
POLICY_DNS_DOMAIN_INFO
));
sizeof
(
POLICY_DNS_DOMAIN_INFO
));
HKEY
key
;
BOOL
useDefault
=
TRUE
;
LONG
ret
;
if
((
ret
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
ADVAPI_GetDomainName
(
&
pinfo
->
Name
);
"System
\\
CurrentControlSet
\\
Services
\\
VxD
\\
VNETSUP"
,
0
,
KEY_READ
,
&
key
))
==
ERROR_SUCCESS
)
{
DWORD
size
=
0
;
static
const
WCHAR
wg
[]
=
{
'W'
,
'o'
,
'r'
,
'k'
,
'g'
,
'r'
,
'o'
,
'u'
,
'p'
,
0
};
ret
=
RegQueryValueExW
(
key
,
wg
,
NULL
,
NULL
,
NULL
,
&
size
);
if
(
ret
==
ERROR_MORE_DATA
||
ret
==
ERROR_SUCCESS
)
{
pinfo
->
Name
.
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
((
ret
=
RegQueryValueExW
(
key
,
wg
,
NULL
,
NULL
,
(
LPBYTE
)
pinfo
->
Name
.
Buffer
,
&
size
))
==
ERROR_SUCCESS
)
{
pinfo
->
Name
.
Length
=
(
USHORT
)(
size
-
sizeof
(
WCHAR
));
pinfo
->
Name
.
MaximumLength
=
(
USHORT
)
size
;
useDefault
=
FALSE
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
pinfo
->
Name
.
Buffer
);
pinfo
->
Name
.
Buffer
=
NULL
;
}
}
RegCloseKey
(
key
);
}
if
(
useDefault
)
RtlCreateUnicodeStringFromAsciiz
(
&
(
pinfo
->
Name
),
"DOMAIN"
);
TRACE
(
"setting domain to %s
\n
"
,
debugstr_w
(
pinfo
->
Name
.
Buffer
));
TRACE
(
"setting domain to %s
\n
"
,
debugstr_w
(
pinfo
->
Name
.
Buffer
));
...
...
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