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
09570eda
Commit
09570eda
authored
Aug 17, 2002
by
Patrik Stridvall
Committed by
Alexandre Julliard
Aug 17, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MSVC compatibility fixes.
parent
42c74d64
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
14 deletions
+67
-14
advapi.c
dlls/advapi32/advapi.c
+9
-6
registry.c
dlls/advapi32/registry.c
+0
-1
debug.c
library/debug.c
+0
-1
loader.c
library/loader.c
+0
-1
port.c
library/port.c
+55
-2
instr.c
memory/instr.c
+3
-3
No files found.
dlls/advapi32/advapi.c
View file @
09570eda
...
...
@@ -23,9 +23,10 @@
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <pwd.h>
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
#include "winbase.h"
#include "windef.h"
...
...
@@ -48,15 +49,17 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
size_t
len
;
char
*
name
;
#ifdef HAVE_GETPWUID
struct
passwd
*
pwd
=
getpwuid
(
getuid
()
);
if
(
!
pwd
)
{
name
=
pwd
?
pwd
->
pw_name
:
NULL
;
#else
name
=
getenv
(
"USER"
);
#endif
if
(
!
name
)
{
ERR
(
"Username lookup failed: %s
\n
"
,
strerror
(
errno
));
return
0
;
}
name
=
pwd
->
pw_name
;
/* We need to include the null character when determining the size of the buffer. */
len
=
strlen
(
name
)
+
1
;
if
(
len
>
*
lpSize
)
...
...
dlls/advapi32/registry.c
View file @
09570eda
...
...
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "winbase.h"
#include "winreg.h"
...
...
library/debug.c
View file @
09570eda
...
...
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include "wine/debug.h"
...
...
library/loader.c
View file @
09570eda
...
...
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
...
...
library/port.c
View file @
09570eda
...
...
@@ -31,7 +31,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_INTTYPES_H
# include <sys/inttypes.h>
...
...
@@ -101,7 +104,7 @@ void *memmove( void *dest, const void *src, unsigned int len )
memcpy
(
dst
,
src
,
len
);
}
/* Otherwise do it the hard way (FIXME: could do better than this) */
else
if
(
dst
<
src
)
else
if
(
dst
<
(
char
*
)
src
)
{
while
(
len
--
)
*
dst
++
=
*
((
char
*
)
src
)
++
;
}
...
...
@@ -668,6 +671,8 @@ char *gcvt (double number, size_t ndigit, char *buff)
*/
#ifdef __i386__
#ifdef __GNUC__
__ASM_GLOBAL_FUNC
(
interlocked_cmpxchg
,
"movl 12(%esp),%eax
\n\t
"
"movl 8(%esp),%ecx
\n\t
"
...
...
@@ -696,6 +701,54 @@ __ASM_GLOBAL_FUNC(interlocked_xchg_add,
"lock; xaddl %eax,(%edx)
\n\t
"
"ret"
);
#elif defined(_MSC_VER)
__declspec
(
naked
)
long
interlocked_cmpxchg
(
long
*
dest
,
long
xchg
,
long
compare
)
{
__asm
mov
eax
,
12
[
esp
];
__asm
mov
ecx
,
8
[
esp
];
__asm
mov
edx
,
4
[
esp
];
__asm
lock
cmpxchg
[
edx
],
ecx
;
__asm
ret
;
}
__declspec
(
naked
)
void
*
interlocked_cmpxchg_ptr
(
void
**
dest
,
void
*
xchg
,
void
*
compare
)
{
__asm
mov
eax
,
12
[
esp
];
__asm
mov
ecx
,
8
[
esp
];
__asm
mov
edx
,
4
[
esp
];
__asm
lock
cmpxchg
[
edx
],
ecx
;
__asm
ret
;
}
__declspec
(
naked
)
long
interlocked_xchg
(
long
*
dest
,
long
val
)
{
__asm
mov
eax
,
8
[
esp
];
__asm
mov
edx
,
4
[
esp
];
__asm
lock
xchg
[
edx
],
eax
;
__asm
ret
;
}
__declspec
(
naked
)
void
*
interlocked_xchg_ptr
(
void
**
dest
,
void
*
val
)
{
__asm
mov
eax
,
8
[
esp
];
__asm
mov
edx
,
4
[
esp
];
__asm
lock
xchg
[
edx
],
eax
;
__asm
ret
;
}
__declspec
(
naked
)
long
interlocked_xchg_add
(
long
*
dest
,
long
incr
)
{
__asm
mov
eax
,
8
[
esp
];
__asm
mov
edx
,
4
[
esp
];
__asm
lock
xadd
[
edx
],
eax
;
__asm
ret
;
}
#else
# error You must implement the interlocked* functions for your compiler
#endif
#elif defined(__powerpc__)
void
*
interlocked_cmpxchg_ptr
(
void
**
dest
,
void
*
xchg
,
void
*
compare
)
{
...
...
memory/instr.c
View file @
09570eda
...
...
@@ -44,7 +44,7 @@ inline static void *make_ptr( CONTEXT86 *context, DWORD seg, DWORD off, int long
if
(
ISV86
(
context
))
return
PTR_REAL_TO_LIN
(
seg
,
off
);
if
(
IS_SELECTOR_SYSTEM
(
seg
))
return
(
void
*
)
off
;
if
(
!
long_addr
)
off
=
LOWORD
(
off
);
return
MapSL
(
MAKESEGPTR
(
seg
,
0
)
)
+
off
;
return
(
char
*
)
MapSL
(
MAKESEGPTR
(
seg
,
0
)
)
+
off
;
}
inline
static
void
*
get_stack
(
CONTEXT86
*
context
)
...
...
@@ -54,7 +54,7 @@ inline static void *get_stack( CONTEXT86 *context )
if
(
IS_SELECTOR_SYSTEM
(
context
->
SegSs
))
return
(
void
*
)
context
->
Esp
;
if
(
IS_SELECTOR_32BIT
(
context
->
SegSs
))
return
MapSL
(
MAKESEGPTR
(
context
->
SegSs
,
0
)
)
+
context
->
Esp
;
return
(
char
*
)
MapSL
(
MAKESEGPTR
(
context
->
SegSs
,
0
)
)
+
context
->
Esp
;
return
MapSL
(
MAKESEGPTR
(
context
->
SegSs
,
LOWORD
(
context
->
Esp
)
)
);
}
...
...
@@ -249,7 +249,7 @@ static BYTE *INSTR_GetOperandAddr( CONTEXT86 *context, BYTE *instr,
if
(
IS_SELECTOR_SYSTEM
(
seg
))
return
(
BYTE
*
)(
base
+
(
index
<<
ss
));
if
(((
seg
&
7
)
!=
7
)
||
IS_SELECTOR_FREE
(
seg
))
return
NULL
;
if
(
wine_ldt_copy
.
limit
[
seg
>>
3
]
<
(
base
+
(
index
<<
ss
)))
return
NULL
;
return
MapSL
(
MAKESEGPTR
(
seg
,
0
)
)
+
base
+
(
index
<<
ss
);
return
(
char
*
)
MapSL
(
MAKESEGPTR
(
seg
,
0
)
)
+
base
+
(
index
<<
ss
);
#undef GET_VAL
}
...
...
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