Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
78cdb254
Commit
78cdb254
authored
3 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
msv1_0: Implement Wow64 entry points in the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1307d44f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/msv1_0/main.c
+1
-3
1 addition, 3 deletions
dlls/msv1_0/main.c
dlls/msv1_0/unixlib.c
+68
-10
68 additions, 10 deletions
dlls/msv1_0/unixlib.c
dlls/msv1_0/unixlib.h
+2
-7
2 additions, 7 deletions
dlls/msv1_0/unixlib.h
with
71 additions
and
20 deletions
dlls/msv1_0/main.c
+
1
−
3
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
)
...
...
This diff is collapsed.
Click to expand it.
dlls/msv1_0/unixlib.c
+
68
−
10
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 */
This diff is collapsed.
Click to expand it.
dlls/msv1_0/unixlib.h
+
2
−
7
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment