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
ba713161
Commit
ba713161
authored
Sep 18, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved a couple more functions to dlls/kernel.
parent
ec398217
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
147 deletions
+98
-147
ne_module.c
dlls/kernel/ne_module.c
+98
-0
module.c
loader/ne/module.c
+0
-110
task.c
loader/task.c
+0
-37
No files found.
dlls/kernel/ne_module.c
View file @
ba713161
...
@@ -1586,6 +1586,104 @@ void WINAPI FreeLibrary16( HINSTANCE16 handle )
...
@@ -1586,6 +1586,104 @@ void WINAPI FreeLibrary16( HINSTANCE16 handle )
}
}
/***********************************************************************
* GetModuleHandle16 (KERNEL32.@)
*/
HMODULE16
WINAPI
GetModuleHandle16
(
LPCSTR
name
)
{
HMODULE16
hModule
=
hFirstModule
;
LPSTR
s
;
BYTE
len
,
*
name_table
;
char
tmpstr
[
MAX_PATH
];
NE_MODULE
*
pModule
;
TRACE
(
"(%s)
\n
"
,
name
);
if
(
!
HIWORD
(
name
))
return
GetExePtr
(
LOWORD
(
name
));
len
=
strlen
(
name
);
if
(
!
len
)
return
0
;
lstrcpynA
(
tmpstr
,
name
,
sizeof
(
tmpstr
));
/* If 'name' matches exactly the module name of a module:
* Return its handle.
*/
for
(
hModule
=
hFirstModule
;
hModule
;
hModule
=
pModule
->
next
)
{
pModule
=
NE_GetPtr
(
hModule
);
if
(
!
pModule
)
break
;
if
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
continue
;
name_table
=
(
BYTE
*
)
pModule
+
pModule
->
name_table
;
if
((
*
name_table
==
len
)
&&
!
strncmp
(
name
,
name_table
+
1
,
len
))
return
hModule
;
}
/* If uppercased 'name' matches exactly the module name of a module:
* Return its handle
*/
for
(
s
=
tmpstr
;
*
s
;
s
++
)
*
s
=
FILE_toupper
(
*
s
);
for
(
hModule
=
hFirstModule
;
hModule
;
hModule
=
pModule
->
next
)
{
pModule
=
NE_GetPtr
(
hModule
);
if
(
!
pModule
)
break
;
if
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
continue
;
name_table
=
(
BYTE
*
)
pModule
+
pModule
->
name_table
;
/* FIXME: the strncasecmp is WRONG. It should not be case insensitive,
* but case sensitive! (Unfortunately Winword 6 and subdlls have
* lowercased module names, but try to load uppercase DLLs, so this
* 'i' compare is just a quickfix until the loader handles that
* correctly. -MM 990705
*/
if
((
*
name_table
==
len
)
&&
!
FILE_strncasecmp
(
tmpstr
,
name_table
+
1
,
len
))
return
hModule
;
}
/* If the base filename of 'name' matches the base filename of the module
* filename of some module (case-insensitive compare):
* Return its handle.
*/
/* basename: search backwards in passed name to \ / or : */
s
=
tmpstr
+
strlen
(
tmpstr
);
while
(
s
>
tmpstr
)
{
if
(
s
[
-
1
]
==
'/'
||
s
[
-
1
]
==
'\\'
||
s
[
-
1
]
==
':'
)
break
;
s
--
;
}
/* search this in loaded filename list */
for
(
hModule
=
hFirstModule
;
hModule
;
hModule
=
pModule
->
next
)
{
char
*
loadedfn
;
OFSTRUCT
*
ofs
;
pModule
=
NE_GetPtr
(
hModule
);
if
(
!
pModule
)
break
;
if
(
!
pModule
->
fileinfo
)
continue
;
if
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
continue
;
ofs
=
(
OFSTRUCT
*
)((
BYTE
*
)
pModule
+
pModule
->
fileinfo
);
loadedfn
=
((
char
*
)
ofs
->
szPathName
)
+
strlen
(
ofs
->
szPathName
);
/* basename: search backwards in pathname to \ / or : */
while
(
loadedfn
>
(
char
*
)
ofs
->
szPathName
)
{
if
(
loadedfn
[
-
1
]
==
'/'
||
loadedfn
[
-
1
]
==
'\\'
||
loadedfn
[
-
1
]
==
':'
)
break
;
loadedfn
--
;
}
/* case insensitive compare ... */
if
(
!
FILE_strcasecmp
(
loadedfn
,
s
))
return
hModule
;
}
return
0
;
}
/**********************************************************************
/**********************************************************************
* GetModuleName (KERNEL.27)
* GetModuleName (KERNEL.27)
*/
*/
...
...
loader/ne/module.c
View file @
ba713161
...
@@ -51,16 +51,6 @@
...
@@ -51,16 +51,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
module
);
WINE_DEFAULT_DEBUG_CHANNEL
(
module
);
WINE_DECLARE_DEBUG_CHANNEL
(
loaddll
);
WINE_DECLARE_DEBUG_CHANNEL
(
loaddll
);
#include "pshpack1.h"
typedef
struct
_GPHANDLERDEF
{
WORD
selector
;
WORD
rangeStart
;
WORD
rangeEnd
;
WORD
handler
;
}
GPHANDLERDEF
;
#include "poppack.h"
#define hFirstModule (pThhook->hExeHead)
#define hFirstModule (pThhook->hExeHead)
...
@@ -97,103 +87,3 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
...
@@ -97,103 +87,3 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
TRACE
(
"%04x -> '%s'
\n
"
,
hModule
,
lpFileName
);
TRACE
(
"%04x -> '%s'
\n
"
,
hModule
,
lpFileName
);
return
strlen
(
lpFileName
);
return
strlen
(
lpFileName
);
}
}
/***********************************************************************
* GetModuleHandle16 (KERNEL32.@)
*/
HMODULE16
WINAPI
GetModuleHandle16
(
LPCSTR
name
)
{
HMODULE16
hModule
=
hFirstModule
;
LPSTR
s
;
BYTE
len
,
*
name_table
;
char
tmpstr
[
MAX_PATH
];
NE_MODULE
*
pModule
;
TRACE
(
"(%s)
\n
"
,
name
);
if
(
!
HIWORD
(
name
))
return
GetExePtr
(
LOWORD
(
name
));
len
=
strlen
(
name
);
if
(
!
len
)
return
0
;
lstrcpynA
(
tmpstr
,
name
,
sizeof
(
tmpstr
));
/* If 'name' matches exactly the module name of a module:
* Return its handle.
*/
for
(
hModule
=
hFirstModule
;
hModule
;
hModule
=
pModule
->
next
)
{
pModule
=
NE_GetPtr
(
hModule
);
if
(
!
pModule
)
break
;
if
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
continue
;
name_table
=
(
BYTE
*
)
pModule
+
pModule
->
name_table
;
if
((
*
name_table
==
len
)
&&
!
strncmp
(
name
,
name_table
+
1
,
len
))
return
hModule
;
}
/* If uppercased 'name' matches exactly the module name of a module:
* Return its handle
*/
for
(
s
=
tmpstr
;
*
s
;
s
++
)
*
s
=
FILE_toupper
(
*
s
);
for
(
hModule
=
hFirstModule
;
hModule
;
hModule
=
pModule
->
next
)
{
pModule
=
NE_GetPtr
(
hModule
);
if
(
!
pModule
)
break
;
if
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
continue
;
name_table
=
(
BYTE
*
)
pModule
+
pModule
->
name_table
;
/* FIXME: the strncasecmp is WRONG. It should not be case insensitive,
* but case sensitive! (Unfortunately Winword 6 and subdlls have
* lowercased module names, but try to load uppercase DLLs, so this
* 'i' compare is just a quickfix until the loader handles that
* correctly. -MM 990705
*/
if
((
*
name_table
==
len
)
&&
!
FILE_strncasecmp
(
tmpstr
,
name_table
+
1
,
len
))
return
hModule
;
}
/* If the base filename of 'name' matches the base filename of the module
* filename of some module (case-insensitive compare):
* Return its handle.
*/
/* basename: search backwards in passed name to \ / or : */
s
=
tmpstr
+
strlen
(
tmpstr
);
while
(
s
>
tmpstr
)
{
if
(
s
[
-
1
]
==
'/'
||
s
[
-
1
]
==
'\\'
||
s
[
-
1
]
==
':'
)
break
;
s
--
;
}
/* search this in loaded filename list */
for
(
hModule
=
hFirstModule
;
hModule
;
hModule
=
pModule
->
next
)
{
char
*
loadedfn
;
OFSTRUCT
*
ofs
;
pModule
=
NE_GetPtr
(
hModule
);
if
(
!
pModule
)
break
;
if
(
!
pModule
->
fileinfo
)
continue
;
if
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
continue
;
ofs
=
(
OFSTRUCT
*
)((
BYTE
*
)
pModule
+
pModule
->
fileinfo
);
loadedfn
=
((
char
*
)
ofs
->
szPathName
)
+
strlen
(
ofs
->
szPathName
);
/* basename: search backwards in pathname to \ / or : */
while
(
loadedfn
>
(
char
*
)
ofs
->
szPathName
)
{
if
(
loadedfn
[
-
1
]
==
'/'
||
loadedfn
[
-
1
]
==
'\\'
||
loadedfn
[
-
1
]
==
':'
)
break
;
loadedfn
--
;
}
/* case insensitive compare ... */
if
(
!
FILE_strcasecmp
(
loadedfn
,
s
))
return
hModule
;
}
return
0
;
}
loader/task.c
View file @
ba713161
...
@@ -68,15 +68,6 @@ static TDB *TASK_GetPtr( HTASK16 hTask )
...
@@ -68,15 +68,6 @@ static TDB *TASK_GetPtr( HTASK16 hTask )
/***********************************************************************
/***********************************************************************
* TASK_GetCurrent
*/
TDB
*
TASK_GetCurrent
(
void
)
{
return
TASK_GetPtr
(
GetCurrentTask
()
);
}
/***********************************************************************
* GetCurrentTask (KERNEL32.@)
* GetCurrentTask (KERNEL32.@)
*/
*/
HTASK16
WINAPI
GetCurrentTask
(
void
)
HTASK16
WINAPI
GetCurrentTask
(
void
)
...
@@ -85,20 +76,6 @@ HTASK16 WINAPI GetCurrentTask(void)
...
@@ -85,20 +76,6 @@ HTASK16 WINAPI GetCurrentTask(void)
}
}
/***********************************************************************
/***********************************************************************
* GetCurrentPDB (KERNEL.37)
*
* UNDOC: returns PSP of KERNEL in high word
*/
DWORD
WINAPI
GetCurrentPDB16
(
void
)
{
TDB
*
pTask
;
if
(
!
(
pTask
=
TASK_GetCurrent
()))
return
0
;
return
MAKELONG
(
pTask
->
hPDB
,
0
);
/* FIXME */
}
/***********************************************************************
* GetExePtrHelper
* GetExePtrHelper
*/
*/
static
inline
HMODULE16
GetExePtrHelper
(
HANDLE16
handle
,
HTASK16
*
hTask
)
static
inline
HMODULE16
GetExePtrHelper
(
HANDLE16
handle
,
HTASK16
*
hTask
)
...
@@ -147,20 +124,6 @@ static inline HMODULE16 GetExePtrHelper( HANDLE16 handle, HTASK16 *hTask )
...
@@ -147,20 +124,6 @@ static inline HMODULE16 GetExePtrHelper( HANDLE16 handle, HTASK16 *hTask )
}
}
/***********************************************************************
/***********************************************************************
* GetExePtr (KERNEL.133)
*/
HMODULE16
WINAPI
WIN16_GetExePtr
(
HANDLE16
handle
)
{
HTASK16
hTask
=
0
;
HMODULE16
hModule
=
GetExePtrHelper
(
handle
,
&
hTask
);
STACK16FRAME
*
frame
=
CURRENT_STACK16
;
frame
->
ecx
=
hModule
;
if
(
hTask
)
frame
->
es
=
hTask
;
return
hModule
;
}
/***********************************************************************
* K228 (KERNEL.228)
* K228 (KERNEL.228)
*/
*/
HMODULE16
WINAPI
GetExePtr
(
HANDLE16
handle
)
HMODULE16
WINAPI
GetExePtr
(
HANDLE16
handle
)
...
...
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