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
d3edafe1
Commit
d3edafe1
authored
Feb 22, 2005
by
Ivan Leo Puoti
Committed by
Alexandre Julliard
Feb 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace GetCurrentProcess() with NtCurrentProcess() in ntdll.
parent
d8793bb7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
30 deletions
+30
-30
handletable.c
dlls/ntdll/handletable.c
+3
-3
heap.c
dlls/ntdll/heap.c
+8
-8
loader.c
dlls/ntdll/loader.c
+6
-6
relay.c
dlls/ntdll/relay.c
+3
-3
thread.c
dlls/ntdll/thread.c
+5
-5
virtual.c
dlls/ntdll/virtual.c
+5
-5
No files found.
dlls/ntdll/handletable.c
View file @
d3edafe1
...
...
@@ -82,7 +82,7 @@ NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE * HandleTable)
/* native version only releases committed memory, but we also release reserved */
return
NtFreeVirtualMemory
(
Ge
tCurrentProcess
(),
N
tCurrentProcess
(),
&
HandleTable
->
FirstHandle
,
&
Size
,
MEM_RELEASE
);
...
...
@@ -111,7 +111,7 @@ static NTSTATUS RtlpAllocateSomeHandles(RTL_HANDLE_TABLE * HandleTable)
/* reserve memory for the handles, but don't commit it yet because we
* probably won't use most of it and it will use up physical memory */
status
=
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
N
tCurrentProcess
(),
&
FirstHandleAddr
,
0
,
&
MaxSize
,
...
...
@@ -134,7 +134,7 @@ static NTSTATUS RtlpAllocateSomeHandles(RTL_HANDLE_TABLE * HandleTable)
return
STATUS_NO_MEMORY
;
/* the handle table is completely full */
status
=
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
N
tCurrentProcess
(),
&
NextAvailAddr
,
0
,
&
CommitSize
,
...
...
dlls/ntdll/heap.c
View file @
d3edafe1
...
...
@@ -338,7 +338,7 @@ static inline BOOL HEAP_Commit( SUBHEAP *subheap, void *ptr )
if
(
size
<=
subheap
->
commitSize
)
return
TRUE
;
size
-=
subheap
->
commitSize
;
ptr
=
(
char
*
)
subheap
+
subheap
->
commitSize
;
if
(
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
ptr
,
0
,
if
(
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
ptr
,
0
,
&
size
,
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
))
{
WARN
(
"Could not commit %08lx bytes at %p for heap %p
\n
"
,
...
...
@@ -367,7 +367,7 @@ static inline BOOL HEAP_Decommit( SUBHEAP *subheap, void *ptr )
decommit_size
=
subheap
->
commitSize
-
size
;
addr
=
(
char
*
)
subheap
+
size
;
if
(
NtFreeVirtualMemory
(
Ge
tCurrentProcess
(),
&
addr
,
&
decommit_size
,
MEM_DECOMMIT
))
if
(
NtFreeVirtualMemory
(
N
tCurrentProcess
(),
&
addr
,
&
decommit_size
,
MEM_DECOMMIT
))
{
WARN
(
"Could not decommit %08lx bytes at %08lx for heap %p
\n
"
,
decommit_size
,
(
DWORD
)((
char
*
)
subheap
+
size
),
subheap
->
heap
);
...
...
@@ -477,7 +477,7 @@ static void HEAP_MakeInUseBlockFree( SUBHEAP *subheap, ARENA_INUSE *pArena )
if
(
pPrev
)
pPrev
->
next
=
subheap
->
next
;
/* Free the memory */
subheap
->
magic
=
0
;
NtFreeVirtualMemory
(
Ge
tCurrentProcess
(),
(
void
**
)
&
subheap
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
N
tCurrentProcess
(),
(
void
**
)
&
subheap
,
&
size
,
MEM_RELEASE
);
return
;
}
...
...
@@ -524,7 +524,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
if
(
flags
&
HEAP_SHARED
)
commitSize
=
totalSize
;
/* always commit everything in a shared heap */
if
(
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
address
,
0
,
if
(
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
address
,
0
,
&
commitSize
,
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
))
{
WARN
(
"Could not commit %08lx bytes for sub-heap %p
\n
"
,
commitSize
,
address
);
...
...
@@ -579,7 +579,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
HANDLE
sem
=
heap
->
critSection
.
LockSemaphore
;
if
(
!
sem
)
NtCreateSemaphore
(
&
sem
,
SEMAPHORE_ALL_ACCESS
,
NULL
,
0
,
1
);
NtDuplicateObject
(
GetCurrentProcess
(),
sem
,
Ge
tCurrentProcess
(),
&
sem
,
0
,
0
,
NtDuplicateObject
(
NtCurrentProcess
(),
sem
,
N
tCurrentProcess
(),
&
sem
,
0
,
0
,
DUP_HANDLE_MAKE_GLOBAL
|
DUP_HANDLE_SAME_ACCESS
|
DUP_HANDLE_CLOSE_SOURCE
);
heap
->
critSection
.
LockSemaphore
=
sem
;
}
...
...
@@ -613,7 +613,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, void *base, DWORD flags,
if
(
!
address
)
{
/* allocate the memory block */
if
(
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
address
,
0
,
&
totalSize
,
if
(
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
address
,
0
,
&
totalSize
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
))
{
WARN
(
"Could not allocate %08lx bytes
\n
"
,
totalSize
);
...
...
@@ -627,7 +627,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, void *base, DWORD flags,
address
,
flags
,
commitSize
,
totalSize
))
{
ULONG
size
=
0
;
if
(
!
base
)
NtFreeVirtualMemory
(
Ge
tCurrentProcess
(),
&
address
,
&
size
,
MEM_RELEASE
);
if
(
!
base
)
NtFreeVirtualMemory
(
N
tCurrentProcess
(),
&
address
,
&
size
,
MEM_RELEASE
);
return
NULL
;
}
...
...
@@ -1066,7 +1066,7 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
SUBHEAP
*
next
=
subheap
->
next
;
ULONG
size
=
0
;
void
*
addr
=
subheap
;
NtFreeVirtualMemory
(
Ge
tCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
N
tCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
subheap
=
next
;
}
return
0
;
...
...
dlls/ntdll/loader.c
View file @
d3edafe1
...
...
@@ -215,7 +215,7 @@ static void *allocate_stub( const char *dll, const char *name )
if
(
!
stubs
)
{
ULONG
size
=
MAX_SIZE
;
if
(
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
(
void
**
)
&
stubs
,
0
,
&
size
,
if
(
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
(
void
**
)
&
stubs
,
0
,
&
size
,
MEM_COMMIT
,
PAGE_EXECUTE_WRITECOPY
)
!=
STATUS_SUCCESS
)
return
(
void
*
)
0xdeadbeef
;
}
...
...
@@ -491,7 +491,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
while
(
import_list
[
protect_size
].
u1
.
Ordinal
)
protect_size
++
;
protect_base
=
thunk_list
;
protect_size
*=
sizeof
(
*
thunk_list
);
NtProtectVirtualMemory
(
Ge
tCurrentProcess
(),
&
protect_base
,
NtProtectVirtualMemory
(
N
tCurrentProcess
(),
&
protect_base
,
&
protect_size
,
PAGE_WRITECOPY
,
&
protect_old
);
imp_mod
=
wmImp
->
ldr
.
BaseAddress
;
...
...
@@ -561,7 +561,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
done:
/* restore old protection of the import address table */
NtProtectVirtualMemory
(
Ge
tCurrentProcess
(),
&
protect_base
,
&
protect_size
,
protect_old
,
NULL
);
NtProtectVirtualMemory
(
N
tCurrentProcess
(),
&
protect_base
,
&
protect_size
,
protect_old
,
NULL
);
return
wmImp
;
}
...
...
@@ -1229,7 +1229,7 @@ static void load_builtin_callback( void *module, const char *filename )
}
wm
->
ldr
.
Flags
|=
LDR_WINE_INTERNAL
;
addr
=
module
;
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
addr
,
0
,
&
nt
->
OptionalHeader
.
SizeOfImage
,
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
addr
,
0
,
&
nt
->
OptionalHeader
.
SizeOfImage
,
MEM_SYSTEM
|
MEM_IMAGE
,
PAGE_EXECUTE_WRITECOPY
);
/* fixup imports */
...
...
@@ -1299,7 +1299,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
module
=
NULL
;
status
=
NtMapViewOfSection
(
mapping
,
Ge
tCurrentProcess
(),
status
=
NtMapViewOfSection
(
mapping
,
N
tCurrentProcess
(),
&
module
,
0
,
0
,
&
size
,
&
len
,
ViewShare
,
0
,
PAGE_READONLY
);
NtClose
(
mapping
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
...
...
@@ -1802,7 +1802,7 @@ static void MODULE_FlushModrefs(void)
}
SERVER_END_REQ
;
NtUnmapViewOfSection
(
Ge
tCurrentProcess
(),
mod
->
BaseAddress
);
NtUnmapViewOfSection
(
N
tCurrentProcess
(),
mod
->
BaseAddress
);
if
(
wm
->
ldr
.
Flags
&
LDR_WINE_INTERNAL
)
wine_dll_unload
(
wm
->
ldr
.
SectionHandle
);
if
(
cached_modref
==
wm
)
cached_modref
=
NULL
;
RtlFreeUnicodeString
(
&
mod
->
FullDllName
);
...
...
dlls/ntdll/relay.c
View file @
d3edafe1
...
...
@@ -820,7 +820,7 @@ void SNOOP_SetupDLL(HMODULE hmod)
/* another dll, loaded at the same address */
addr
=
(
*
dll
)
->
funs
;
size
=
(
*
dll
)
->
nrofordinals
*
sizeof
(
SNOOP_FUN
);
NtFreeVirtualMemory
(
Ge
tCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
N
tCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
break
;
}
dll
=
&
((
*
dll
)
->
next
);
...
...
@@ -842,7 +842,7 @@ void SNOOP_SetupDLL(HMODULE hmod)
size
=
exports
->
NumberOfFunctions
*
sizeof
(
SNOOP_FUN
);
addr
=
NULL
;
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
addr
,
0
,
&
size
,
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
addr
,
0
,
&
size
,
MEM_COMMIT
|
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
);
if
(
!
addr
)
{
RtlFreeHeap
(
GetProcessHeap
(),
0
,
*
dll
);
...
...
@@ -1009,7 +1009,7 @@ void WINAPI SNOOP_DoEntry( CONTEXT86 *context )
SIZE_T
size
=
4096
;
VOID
*
addr
=
NULL
;
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
addr
,
0
,
&
size
,
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
addr
,
0
,
&
size
,
MEM_COMMIT
|
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
);
if
(
!
addr
)
return
;
...
...
dlls/ntdll/thread.c
View file @
d3edafe1
...
...
@@ -85,7 +85,7 @@ static inline void free_teb( TEB *teb )
ULONG
size
=
0
;
void
*
addr
=
teb
;
NtFreeVirtualMemory
(
Ge
tCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
N
tCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
wine_ldt_free_fs
(
teb
->
teb_sel
);
munmap
(
teb
,
SIGNAL_STACK_SIZE
+
sizeof
(
TEB
)
);
}
...
...
@@ -143,7 +143,7 @@ void thread_init(void)
/* create a memory view for the TEB */
addr
=
teb
;
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
addr
,
0
,
&
size
,
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
addr
,
0
,
&
size
,
MEM_SYSTEM
,
PAGE_EXECUTE_READWRITE
);
/* create the process heap */
...
...
@@ -181,7 +181,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
/* allocate a memory view for the stack */
size
=
info
->
stack_size
;
teb
->
DeallocationStack
=
info
->
stack_base
;
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
teb
->
DeallocationStack
,
0
,
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
teb
->
DeallocationStack
,
0
,
&
size
,
MEM_SYSTEM
,
PAGE_EXECUTE_READWRITE
);
/* limit is lower than base since the stack grows down */
teb
->
Tib
.
StackBase
=
(
char
*
)
info
->
stack_base
+
info
->
stack_size
;
...
...
@@ -189,7 +189,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
/* setup the guard page */
size
=
1
;
NtProtectVirtualMemory
(
Ge
tCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
NtProtectVirtualMemory
(
N
tCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
PAGE_EXECUTE_READWRITE
|
PAGE_GUARD
,
NULL
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
info
);
...
...
@@ -266,7 +266,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
teb
->
htask16
=
NtCurrentTeb
()
->
htask16
;
info
->
pthread_info
.
teb_base
=
teb
;
NtAllocateVirtualMemory
(
Ge
tCurrentProcess
(),
&
info
->
pthread_info
.
teb_base
,
0
,
&
size
,
NtAllocateVirtualMemory
(
N
tCurrentProcess
(),
&
info
->
pthread_info
.
teb_base
,
0
,
&
size
,
MEM_SYSTEM
,
PAGE_EXECUTE_READWRITE
);
info
->
pthread_info
.
teb_size
=
size
;
info
->
pthread_info
.
teb_sel
=
teb
->
teb_sel
;
...
...
dlls/ntdll/virtual.c
View file @
d3edafe1
...
...
@@ -1044,8 +1044,8 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, DWORD total_size
done:
if
(
!
removable
)
/* don't keep handle open on removable media */
NtDuplicateObject
(
Ge
tCurrentProcess
(),
hmapping
,
Ge
tCurrentProcess
(),
&
view
->
mapping
,
NtDuplicateObject
(
N
tCurrentProcess
(),
hmapping
,
N
tCurrentProcess
(),
&
view
->
mapping
,
0
,
0
,
DUPLICATE_SAME_ACCESS
);
RtlLeaveCriticalSection
(
&
csVirtual
);
...
...
@@ -1069,7 +1069,7 @@ BOOL is_current_process( HANDLE handle )
{
BOOL
ret
=
FALSE
;
if
(
handle
==
Ge
tCurrentProcess
())
return
TRUE
;
if
(
handle
==
N
tCurrentProcess
())
return
TRUE
;
SERVER_START_REQ
(
get_process_info
)
{
req
->
handle
=
handle
;
...
...
@@ -1777,8 +1777,8 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
if
(
res
==
STATUS_SUCCESS
)
{
if
(
!
removable
)
/* don't keep handle open on removable media */
NtDuplicateObject
(
Ge
tCurrentProcess
(),
handle
,
Ge
tCurrentProcess
(),
&
view
->
mapping
,
NtDuplicateObject
(
N
tCurrentProcess
(),
handle
,
N
tCurrentProcess
(),
&
view
->
mapping
,
0
,
0
,
DUPLICATE_SAME_ACCESS
);
*
addr_ptr
=
view
->
base
;
...
...
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