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
78cdb254
Commit
78cdb254
authored
Nov 09, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msv1_0: Implement Wow64 entry points in the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1307d44f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
20 deletions
+71
-20
main.c
dlls/msv1_0/main.c
+1
-3
unixlib.c
dlls/msv1_0/unixlib.c
+68
-10
unixlib.h
dlls/msv1_0/unixlib.h
+2
-7
No files found.
dlls/msv1_0/main.c
View file @
78cdb254
...
...
@@ -51,9 +51,7 @@ static NTSTATUS ntlm_check_version(void)
static
void
ntlm_cleanup
(
struct
ntlm_ctx
*
ctx
)
{
struct
cleanup_params
params
=
{
ctx
};
__wine_unix_call
(
ntlm_handle
,
unix_cleanup
,
&
params
);
__wine_unix_call
(
ntlm_handle
,
unix_cleanup
,
ctx
);
}
static
NTSTATUS
ntlm_chat
(
struct
ntlm_ctx
*
ctx
,
char
*
buf
,
unsigned
int
buflen
,
unsigned
int
*
retlen
)
...
...
dlls/msv1_0/unixlib.c
View file @
78cdb254
...
...
@@ -54,7 +54,7 @@ struct com_buf
static
SECURITY_STATUS
read_line
(
struct
ntlm_ctx
*
ctx
,
unsigned
int
*
offset
)
{
char
*
newline
;
struct
com_buf
*
com_buf
=
ctx
->
com_buf
;
struct
com_buf
*
com_buf
=
(
struct
com_buf
*
)(
ULONG_PTR
)
ctx
->
com_buf
;
if
(
!
com_buf
)
{
...
...
@@ -66,7 +66,7 @@ static SECURITY_STATUS read_line( struct ntlm_ctx *ctx, unsigned int *offset )
}
com_buf
->
size
=
INITIAL_BUFFER_SIZE
;
com_buf
->
offset
=
0
;
ctx
->
com_buf
=
com_buf
;
ctx
->
com_buf
=
(
ULONG_PTR
)
com_buf
;
}
do
...
...
@@ -97,7 +97,7 @@ static SECURITY_STATUS read_line( struct ntlm_ctx *ctx, unsigned int *offset )
static
NTSTATUS
ntlm_chat
(
void
*
args
)
{
struct
chat_params
*
params
=
args
;
const
struct
chat_params
*
params
=
args
;
struct
ntlm_ctx
*
ctx
=
params
->
ctx
;
struct
com_buf
*
com_buf
;
SECURITY_STATUS
status
=
SEC_E_OK
;
...
...
@@ -107,7 +107,7 @@ static NTSTATUS ntlm_chat( void *args )
write
(
ctx
->
pipe_out
,
"
\n
"
,
1
);
if
((
status
=
read_line
(
ctx
,
&
offset
))
!=
SEC_E_OK
)
return
status
;
com_buf
=
ctx
->
com_buf
;
com_buf
=
(
struct
com_buf
*
)(
ULONG_PTR
)
ctx
->
com_buf
;
*
params
->
retlen
=
strlen
(
com_buf
->
buffer
);
if
(
*
params
->
retlen
>
params
->
buflen
)
return
SEC_E_BUFFER_TOO_SMALL
;
...
...
@@ -128,9 +128,8 @@ static NTSTATUS ntlm_chat( void *args )
static
NTSTATUS
ntlm_cleanup
(
void
*
args
)
{
struct
cleanup_params
*
params
=
args
;
struct
ntlm_ctx
*
ctx
=
params
->
ctx
;
struct
com_buf
*
com_buf
=
ctx
->
com_buf
;
struct
ntlm_ctx
*
ctx
=
args
;
struct
com_buf
*
com_buf
=
(
struct
com_buf
*
)(
ULONG_PTR
)
ctx
->
com_buf
;
if
(
!
ctx
||
(
ctx
->
mode
!=
MODE_CLIENT
&&
ctx
->
mode
!=
MODE_SERVER
))
return
STATUS_INVALID_HANDLE
;
ctx
->
mode
=
MODE_INVALID
;
...
...
@@ -154,7 +153,7 @@ static NTSTATUS ntlm_cleanup( void *args )
static
NTSTATUS
ntlm_fork
(
void
*
args
)
{
struct
fork_params
*
params
=
args
;
const
struct
fork_params
*
params
=
args
;
struct
ntlm_ctx
*
ctx
=
params
->
ctx
;
int
pipe_in
[
2
],
pipe_out
[
2
];
...
...
@@ -216,7 +215,6 @@ static NTSTATUS ntlm_check_version( void *args )
char
*
argv
[
3
],
buf
[
80
];
NTSTATUS
status
=
STATUS_DLL_NOT_FOUND
;
struct
fork_params
params
=
{
&
ctx
,
argv
};
struct
cleanup_params
cleanup_params
=
{
&
ctx
};
int
len
;
argv
[
0
]
=
(
char
*
)
"ntlm_auth"
;
...
...
@@ -249,7 +247,7 @@ static NTSTATUS ntlm_check_version( void *args )
"Make sure that ntlm_auth >= %d.%d.%d is in your path. "
"Usually, you can find it in the winbind package of your distribution.
\n
"
,
NTLM_AUTH_MAJOR_VERSION
,
NTLM_AUTH_MINOR_VERSION
,
NTLM_AUTH_MICRO_VERSION
);
ntlm_cleanup
(
&
c
leanup_params
);
ntlm_cleanup
(
&
c
tx
);
return
status
;
}
...
...
@@ -260,3 +258,63 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
ntlm_fork
,
ntlm_check_version
,
};
#ifdef _WIN64
typedef
ULONG
PTR32
;
static
NTSTATUS
wow64_ntlm_chat
(
void
*
args
)
{
struct
{
PTR32
ctx
;
PTR32
buf
;
UINT
buflen
;
PTR32
retlen
;
}
const
*
params32
=
args
;
struct
chat_params
params
=
{
ULongToPtr
(
params32
->
ctx
),
ULongToPtr
(
params32
->
buf
),
params32
->
buflen
,
ULongToPtr
(
params32
->
retlen
)
};
return
ntlm_chat
(
&
params
);
}
static
NTSTATUS
wow64_ntlm_fork
(
void
*
args
)
{
struct
{
PTR32
ctx
;
PTR32
argv
;
}
const
*
params32
=
args
;
struct
fork_params
params
;
PTR32
*
argv32
=
ULongToPtr
(
params32
->
argv
);
char
**
argv
;
NTSTATUS
ret
;
int
i
,
argc
=
0
;
while
(
argv32
[
argc
])
argc
++
;
argv
=
malloc
(
(
argc
+
1
)
*
sizeof
(
*
argv
)
);
for
(
i
=
0
;
i
<=
argc
;
i
++
)
argv
[
i
]
=
ULongToPtr
(
argv32
[
i
]
);
params
.
ctx
=
ULongToPtr
(
params32
->
ctx
);
params
.
argv
=
argv
;
ret
=
ntlm_fork
(
&
params
);
free
(
argv
);
return
ret
;
}
const
unixlib_entry_t
__wine_unix_call_wow64_funcs
[]
=
{
wow64_ntlm_chat
,
ntlm_cleanup
,
wow64_ntlm_fork
,
ntlm_check_version
,
};
#endif
/* _WIN64 */
dlls/msv1_0/unixlib.h
View file @
78cdb254
...
...
@@ -57,7 +57,7 @@ struct arc4_info
#define FLAG_NEGOTIATE_NTLM2 0x00080000
#define FLAG_NEGOTIATE_KEY_EXCHANGE 0x40000000
struct
com_buf
;
typedef
UINT64
com_buf_ptr
;
struct
ntlm_ctx
{
...
...
@@ -68,7 +68,7 @@ struct ntlm_ctx
int
pipe_out
;
char
session_key
[
16
];
unsigned
int
flags
;
struct
com_buf
*
com_buf
;
com_buf_ptr
com_buf
;
struct
{
struct
...
...
@@ -99,11 +99,6 @@ struct chat_params
unsigned
int
*
retlen
;
};
struct
cleanup_params
{
struct
ntlm_ctx
*
ctx
;
};
struct
fork_params
{
struct
ntlm_ctx
*
ctx
;
...
...
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