move printfs to DEBUG only, enable nsprlogging during DEBUG, some bugfixes.

This commit is contained in:
dougt%meer.net 2005-01-28 20:13:47 +00:00
Родитель add7ee1614
Коммит 7d75070663
19 изменённых файлов: 539 добавлений и 131 удалений

Просмотреть файл

@ -42,7 +42,9 @@ extern "C" {
MOZCE_SHUNT_API void mozce_assert(int inExpression)
{
#ifdef DEBUG
printf("mozce_assert called\n");
#endif
if(0 == inExpression)
{

Двоичные данные
build/wince/shunt/build/shunt.vcb

Двоичный файл не отображается.

Просмотреть файл

@ -3,71 +3,150 @@
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: shunt - Win32 (WCE ARMV4) Release--------------------
--------------------Configuration: shunt - Win32 (WCE emulator) Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP7BE.tmp" with contents
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP58.tmp" with contents
[
/nologo /W3 /I "../include" /D "ARM" /D "_ARM_" /D "ARMV4" /D "NDEBUG" /D _WIN32_WCE=420 /D "WIN32_PLATFORM_PSPC=400" /D UNDER_CE=420 /D "UNICODE" /D "_UNICODE" /D "SHUNT_EXPORTS" /D "MOZCE_SHUNT_EXPORTS" /FR"ARMV4Rel/" /Fo"ARMV4Rel/" /O2 /MC /c
"C:\builds\wince_port\wince\shunt\win32A.cpp"
/nologo /W3 /I "../include" /D "_i386_" /D "_X86_" /D "x86" /D "NDEBUG" /D _WIN32_WCE=420 /D "WIN32_PLATFORM_PSPC=400" /D UNDER_CE=420 /D "UNICODE" /D "_UNICODE" /D "SHUNT_EXPORTS" /D "MOZCE_SHUNT_EXPORTS" /Fo"emulatorRel/" /Gs8192 /GF /O2 /c
"C:\builds\wince_port\wince\mozilla\build\wince\shunt\process.cpp"
]
Creating command line "clarm.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP7BE.tmp"
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP7BF.tmp" with contents
Creating command line "cl.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP58.tmp"
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP59.tmp" with contents
[
commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /pdb:none /incremental:no /nodefaultlib:"libc.lib /nodefaultlib:libcd.lib /nodefaultlib:libcmt.lib /nodefaultlib:libcmtd.lib /nodefaultlib:msvcrt.lib /nodefaultlib:msvcrtd.lib" /out:"ARMV4Rel/shunt.dll" /implib:"ARMV4Rel/shunt.lib" /subsystem:windowsce,4.20 /align:"4096" /MACHINE:ARM
.\ARMV4Rel\a2w.obj
.\ARMV4Rel\assert.obj
.\ARMV4Rel\direct.obj
.\ARMV4Rel\errno.obj
.\ARMV4Rel\io.obj
.\ARMV4Rel\mbstring.obj
.\ARMV4Rel\process.obj
.\ARMV4Rel\signal.obj
.\ARMV4Rel\stat.obj
.\ARMV4Rel\stdio.obj
.\ARMV4Rel\stdlib.obj
.\ARMV4Rel\string.obj
.\ARMV4Rel\time.obj
.\ARMV4Rel\w2a.obj
.\ARMV4Rel\win32.obj
.\ARMV4Rel\win32A.obj
.\ARMV4Rel\win32W.obj
commctrl.lib coredll.lib corelibc.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /pdb:none /incremental:no /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:libc.lib /nodefaultlib:libcd.lib /nodefaultlib:libcmt.lib /nodefaultlib:libcmtd.lib /nodefaultlib:msvcrt.lib /nodefaultlib:msvcrtd.lib /out:"emulatorRel/shunt.dll" /implib:"emulatorRel/shunt.lib" /subsystem:windowsce,4.20 /MACHINE:IX86
.\emulatorRel\a2w.obj
.\emulatorRel\assert.obj
.\emulatorRel\direct.obj
.\emulatorRel\errno.obj
.\emulatorRel\io.obj
.\emulatorRel\mbstring.obj
.\emulatorRel\process.obj
.\emulatorRel\signal.obj
.\emulatorRel\stat.obj
.\emulatorRel\stdio.obj
.\emulatorRel\stdlib.obj
.\emulatorRel\string.obj
.\emulatorRel\time.obj
.\emulatorRel\w2a.obj
.\emulatorRel\win32.obj
.\emulatorRel\win32A.obj
.\emulatorRel\win32W.obj
]
Creating command line "link.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP7BF.tmp"
Creating command line "link.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP59.tmp"
<h3>Output Window</h3>
Compiling...
win32A.cpp
process.cpp
Linking...
Creating library ARMV4Rel/shunt.lib and object ARMV4Rel/shunt.exp
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP7C3.tmp" with contents
[
/nologo /o"ARMV4Rel/shunt.bsc"
.\ARMV4Rel\a2w.sbr
.\ARMV4Rel\assert.sbr
.\ARMV4Rel\direct.sbr
.\ARMV4Rel\errno.sbr
.\ARMV4Rel\io.sbr
.\ARMV4Rel\mbstring.sbr
.\ARMV4Rel\process.sbr
.\ARMV4Rel\signal.sbr
.\ARMV4Rel\stat.sbr
.\ARMV4Rel\stdio.sbr
.\ARMV4Rel\stdlib.sbr
.\ARMV4Rel\string.sbr
.\ARMV4Rel\time.sbr
.\ARMV4Rel\w2a.sbr
.\ARMV4Rel\win32.sbr
.\ARMV4Rel\win32A.sbr
.\ARMV4Rel\win32W.sbr]
Creating command line "bscmake.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP7C3.tmp"
Creating browse info file...
<h3>Output Window</h3>
Creating library emulatorRel/shunt.lib and object emulatorRel/shunt.exp
<h3>Results</h3>
shunt.dll - 0 error(s), 0 warning(s)
<h3>
--------------------Configuration: shunt - Win32 (WCE emulator) Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP5D.tmp" with contents
[
/nologo /W3 /Zi /Od /I "../include" /D "DEBUG" /D "_i386_" /D "_X86_" /D "x86" /D _WIN32_WCE=420 /D "WIN32_PLATFORM_PSPC=400" /D UNDER_CE=420 /D "UNICODE" /D "_UNICODE" /D "SHUNT_EXPORTS" /D "MOZCE_SHUNT_EXPORTS" /Fo"emulatorDbg/" /Fd"emulatorDbg/" /Gs8192 /GF /c
"C:\builds\wince_port\wince\mozilla\build\wince\shunt\process.cpp"
]
Creating command line "cl.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP5D.tmp"
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP5E.tmp" with contents
[
commctrl.lib coredll.lib corelibc.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /pdb:none /incremental:yes /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:libc.lib /nodefaultlib:libcd.lib /nodefaultlib:libcmt.lib /nodefaultlib:libcmtd.lib /nodefaultlib:msvcrt.lib /nodefaultlib:msvcrtd.lib /out:"emulatorDbg/shunt.dll" /implib:"emulatorDbg/shunt.lib" /subsystem:windowsce,4.20 /MACHINE:IX86
.\emulatorDbg\a2w.obj
.\emulatorDbg\assert.obj
.\emulatorDbg\direct.obj
.\emulatorDbg\errno.obj
.\emulatorDbg\io.obj
.\emulatorDbg\mbstring.obj
.\emulatorDbg\process.obj
.\emulatorDbg\signal.obj
.\emulatorDbg\stat.obj
.\emulatorDbg\stdio.obj
.\emulatorDbg\stdlib.obj
.\emulatorDbg\string.obj
.\emulatorDbg\time.obj
.\emulatorDbg\w2a.obj
.\emulatorDbg\win32.obj
.\emulatorDbg\win32A.obj
.\emulatorDbg\win32W.obj
]
Creating command line "link.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP5E.tmp"
<h3>Output Window</h3>
Compiling...
process.cpp
Linking...
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/PDB:NONE' specification
Creating library emulatorDbg/shunt.lib and object emulatorDbg/shunt.exp
<h3>Results</h3>
shunt.dll - 0 error(s), 1 warning(s)
<h3>
--------------------Configuration: shunt - Win32 (WCE ARMV4) Release--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
shunt.dll - 0 error(s), 0 warning(s)
<h3>
--------------------Configuration: shunt - Win32 (WCE ARMV4) Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP62.tmp" with contents
[
/nologo /W3 /Zi /Od /I "../include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D _WIN32_WCE=420 /D "WIN32_PLATFORM_PSPC=400" /D UNDER_CE=420 /D "UNICODE" /D "_UNICODE" /D "SHUNT_EXPORTS" /D "MOZCE_SHUNT_EXPORTS" /Fo"ARMV4Dbg/" /Fd"ARMV4Dbg/" /MC /c
"C:\builds\wince_port\wince\mozilla\build\wince\shunt\process.cpp"
]
Creating command line "clarm.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP62.tmp"
Creating temporary file "C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP63.tmp" with contents
[
commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /pdb:none /incremental:yes /debug /nodefaultlib:"libc.lib /nodefaultlib:libcd.lib /nodefaultlib:libcmt.lib /nodefaultlib:libcmtd.lib /nodefaultlib:msvcrt.lib /nodefaultlib:msvcrtd.lib" /out:"ARMV4Dbg/shunt.dll" /implib:"ARMV4Dbg/shunt.lib" /subsystem:windowsce,4.20 /align:"4096" /MACHINE:ARM
.\ARMV4Dbg\a2w.obj
.\ARMV4Dbg\assert.obj
.\ARMV4Dbg\direct.obj
.\ARMV4Dbg\errno.obj
.\ARMV4Dbg\io.obj
.\ARMV4Dbg\mbstring.obj
.\ARMV4Dbg\process.obj
.\ARMV4Dbg\signal.obj
.\ARMV4Dbg\stat.obj
.\ARMV4Dbg\stdio.obj
.\ARMV4Dbg\stdlib.obj
.\ARMV4Dbg\string.obj
.\ARMV4Dbg\time.obj
.\ARMV4Dbg\w2a.obj
.\ARMV4Dbg\win32.obj
.\ARMV4Dbg\win32A.obj
.\ARMV4Dbg\win32W.obj
]
Creating command line "link.exe @C:\DOCUME~1\dougt\LOCALS~1\Temp\RSP63.tmp"
<h3>Output Window</h3>
Compiling...
process.cpp
Linking...
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/PDB:NONE' specification
Creating library ARMV4Dbg/shunt.lib and object ARMV4Dbg/shunt.exp
<h3>Results</h3>
shunt.dll - 0 error(s), 1 warning(s)
</pre>
</body>
</html>

Двоичные данные
build/wince/shunt/build/shunt.vco

Двоичный файл не отображается.

Просмотреть файл

@ -44,7 +44,9 @@ extern "C" {
MOZCE_SHUNT_API int mozce_mkdir(const char* inDirname)
{
#ifdef DEBUG
printf("mozce_mkdir called\n");
#endif
int retval = -1;
@ -67,7 +69,9 @@ MOZCE_SHUNT_API int mozce_mkdir(const char* inDirname)
MOZCE_SHUNT_API int mozce_rmdir(const char* inDirname)
{
#ifdef DEBUG
printf("mozce_rmdir called (%s)\n", inDirname);
#endif
int retval = -1;

Просмотреть файл

@ -253,7 +253,6 @@ typedef struct mozce_OUTLINETEXTMETRIC
#define DISPID_WINDOWACTIVATE (__LINE__ + 3000) /* 111 */
#define OUT_TT_PRECIS 4
#define CBM_INIT 4
#endif

Просмотреть файл

@ -278,13 +278,18 @@
#define CallWindowProcA CallWindowProcW
#define GetWindowLongA GetWindowLongW
#define SetWindowLongA SetWindowLongW
#undef FindFirstFile
#undef FindNextFile
#define FindFirstFile FindFirstFileW
#define FindNextFile FindNextFileW
/*
#define GetProp mozce_GetPropA
#define SetProp mozce_SetPropA
#define RemoveProp mozce_RemovePropA
*/
// From win32w.cpp
#define GetCurrentDirectory mozce_GetCurrentDirectoryW

Просмотреть файл

@ -43,7 +43,9 @@ extern "C" {
MOZCE_SHUNT_API int mozce_chmod(const char* inFilename, int inMode)
{
#ifdef DEBUG
printf("mozce_chmod called\n");
#endif
int retval = -1;
@ -83,7 +85,9 @@ MOZCE_SHUNT_API int mozce_chmod(const char* inFilename, int inMode)
MOZCE_SHUNT_API int mozce_isatty(int inHandle)
{
#ifdef DEBUG
printf("mozce_isatty called\n");
#endif
int retval = 0;

Просмотреть файл

@ -51,7 +51,9 @@ extern "C" {
MOZCE_SHUNT_API unsigned char* mozce_mbsinc(const unsigned char* inCurrent)
{
#ifdef LOG_CALLS
#ifdef DEBUG
printf("mozce_mbsinc called\n");
#endif
#endif
//IsDBCSLeadByte(path[len-1])
return (unsigned char*)(inCurrent + 1);
@ -61,7 +63,9 @@ MOZCE_SHUNT_API unsigned char* mozce_mbsinc(const unsigned char* inCurrent)
MOZCE_SHUNT_API unsigned char* mozce_mbspbrk(const unsigned char* inString, const unsigned char* inStrCharSet)
{
#ifdef LOG_CALLS
#ifdef DEBUG
printf("mozce_mbspbrk called\n");
#endif
#endif
LPWSTR wstring = a2w_malloc((const char *)inString, -1, NULL);
@ -76,7 +80,9 @@ MOZCE_SHUNT_API unsigned char* mozce_mbspbrk(const unsigned char* inString, cons
MOZCE_SHUNT_API unsigned char* mozce_mbsrchr(const unsigned char* inString, unsigned int inC)
{
#ifdef LOG_CALLS
#ifdef DEBUG
printf("mozce_mbsrchr called\n");
#endif
#endif
return (unsigned char*) strrchr((char*)inString, inC);
@ -86,7 +92,9 @@ MOZCE_SHUNT_API unsigned char* mozce_mbsrchr(const unsigned char* inString, unsi
MOZCE_SHUNT_API unsigned char* mozce_mbschr(const unsigned char* inString, unsigned int inC)
{
#ifdef LOG_CALLS
#ifdef DEBUG
printf("mozce_mbschr called\n");
#endif
#endif
return (unsigned char*)strchr((const char*)inString, (int)inC);
}

Просмотреть файл

@ -44,7 +44,9 @@ extern "C" {
MOZCE_SHUNT_API void mozce_abort(void)
{
#ifdef DEBUG
printf("mozce_abort called\n");
#endif
#if defined(DEBUG)
DebugBreak();
@ -55,24 +57,39 @@ printf("mozce_abort called\n");
MOZCE_SHUNT_API char* mozce_getenv(const char* inName)
{
#ifdef DEBUG
printf("mozce_getenv called (%s)\n", inName);
#endif
char* retval = NULL;
// if (!strcmp(inName, "NSPR_LOG_MODULES"))
// return "all:5";
#ifdef DEBUG
if (!strcmp(inName, "NSPR_LOG_MODULES"))
return "all:5";
if (!strcmp(inName, "NSPR_LOG_FILE"))
return "nspr.log";
#endif
return retval;
}
MOZCE_SHUNT_API int mozce_putenv(const char *a)
{
#ifdef DEBUG
printf("mozce_putenv called\n");
#endif
return 0;
}
MOZCE_SHUNT_API int mozce_getpid(void)
{
#ifdef DEBUG
printf("mozce_getpid called\n");
#endif
int retval = 0;

Просмотреть файл

@ -54,7 +54,9 @@ static void defaultSighandler(int inSignal)
MOZCE_SHUNT_API int mozce_raise(int inSignal)
{
#ifdef DEBUG
printf("mozce_raise called\n");
#endif
void (*handler)(int inSignal) = defaultSighandler;
@ -73,7 +75,9 @@ MOZCE_SHUNT_API int mozce_raise(int inSignal)
MOZCE_SHUNT_API _sigsig mozce_signal(int inSignal, _sigsig inFunc)
{
#ifdef DEBUG
printf("mozce_signal called\n");
#endif
void (*retval)(int inSignal) = defaultSighandler;

Просмотреть файл

@ -45,7 +45,9 @@ extern "C" {
MOZCE_SHUNT_API int mozce_stat(const char* inPath, struct stat* outStats)
{
#ifdef DEBUG
printf("mozce_stat called\n");
#endif
int retval = -1;

Просмотреть файл

@ -43,7 +43,9 @@ extern "C" {
MOZCE_SHUNT_API void mozce_rewind(FILE* inStream)
{
#ifdef DEBUG
printf("mozce_rewind called\n");
#endif
fseek(inStream, 0, SEEK_SET);
}
@ -51,7 +53,9 @@ MOZCE_SHUNT_API void mozce_rewind(FILE* inStream)
MOZCE_SHUNT_API FILE* mozce_fdopen(int inFD, const char* inMode)
{
#ifdef DEBUG
printf("mozce_fdopen called\n");
#endif
FILE* retval = NULL;
@ -72,7 +76,9 @@ MOZCE_SHUNT_API FILE* mozce_fdopen(int inFD, const char* inMode)
MOZCE_SHUNT_API void mozce_perror(const char* inString)
{
#ifdef DEBUG
printf("mozce_perror called\n");
#endif
fprintf(stderr, "%s", inString);
}
@ -80,7 +86,9 @@ MOZCE_SHUNT_API void mozce_perror(const char* inString)
MOZCE_SHUNT_API int mozce_remove(const char* inPath)
{
#ifdef DEBUG
printf("mozce_remove called on %s\n", inPath);
#endif
int retval = -1;
@ -103,7 +111,9 @@ MOZCE_SHUNT_API int mozce_remove(const char* inPath)
MOZCE_SHUNT_API char* mozce_getcwd(char* buff, size_t size)
{
#ifdef DEBUG
printf("mozce_getcwd called. NOT IMPLEMENTED!!\n");
#endif
return NULL;
}

Просмотреть файл

@ -47,7 +47,9 @@ extern "C" {
MOZCE_SHUNT_API char *mozce_fullpath(char *absPath, const char *relPath, size_t maxLength)
{
#ifdef LOG_CALLS
#ifdef DEBUG
printf("*mozce_fullpath called\n");
#endif
#endif
return 0;
}
@ -55,7 +57,9 @@ MOZCE_SHUNT_API char *mozce_fullpath(char *absPath, const char *relPath, size_t
MOZCE_SHUNT_API void mozce_splitpath(const char* inPath, char* outDrive, char* outDir, char* outFname, char* outExt)
{
#ifdef LOG_CALLS
#ifdef DEBUG
printf("mozce_splitpath called\n");
#endif
#endif
if(NULL != outDrive)
{
@ -162,7 +166,9 @@ MOZCE_SHUNT_API void mozce_splitpath(const char* inPath, char* outDrive, char* o
MOZCE_SHUNT_API void mozce_makepath(char* outPath, const char* inDrive, const char* inDir, const char* inFname, const char* inExt)
{
#ifdef LOG_CALLS
#ifdef DEBUG
printf("mozce_makepath called\n");
#endif
#endif
if(NULL != outPath)
{
@ -176,19 +182,21 @@ MOZCE_SHUNT_API void mozce_makepath(char* outPath, const char* inDrive, const ch
}
}
_snprintf(outPath, _MAX_PATH, "%s%s%s%s%s",
(NULL != inDir) ? inDir : "",
(NULL != inDir && '\\' != inDir[dirLen] && '/' != inDir[dirLen]) ? "\\" : "",
(NULL != inFname) ? inFname : "",
(NULL != inExt && '.' != inExt[0]) ? "." : "",
(NULL != inExt) ? inExt : ""
);
(NULL != inDir) ? inDir : "",
(NULL != inDir && '\\' != inDir[dirLen] && '/' != inDir[dirLen]) ? "\\" : "",
(NULL != inFname) ? inFname : "",
(NULL != inExt && '.' != inExt[0]) ? "." : "",
(NULL != inExt) ? inExt : ""
);
}
}
MOZCE_SHUNT_API int mozce_strcmpi(const char *dest, const char *src)
{
#ifdef LOG_CALLS
#ifdef DEBUG
printf("mozce_strcmpi called\n");
#endif
#endif
int f,l;

Просмотреть файл

@ -42,8 +42,9 @@ extern "C" {
MOZCE_SHUNT_API char* mozce_strerror(int inErrno)
{
#ifdef DEBUG
printf("mozce_strerror called\n");
#endif
return "Unknown Error";
}

Просмотреть файл

@ -49,7 +49,9 @@ static struct tm tmStorage;
MOZCE_SHUNT_API size_t mozce_strftime(char *, size_t, const char *, const struct tm *)
{
#ifdef DEBUG
printf("mozce_strftime called\n");
#endif
return 0;
}
@ -57,7 +59,9 @@ MOZCE_SHUNT_API size_t mozce_strftime(char *, size_t, const char *, const struct
MOZCE_SHUNT_API struct tm* mozce_localtime_r(const time_t* inTimeT,struct tm* outRetval)
{
#ifdef DEBUG
printf("tm* mozce_localtime_r called\n");
#endif
struct tm* retval = NULL;
@ -104,7 +108,9 @@ MOZCE_SHUNT_API struct tm* mozce_localtime_r(const time_t* inTimeT,struct tm* ou
MOZCE_SHUNT_API struct tm* mozce_localtime(const time_t* inTimeT)
{
#ifdef DEBUG
printf("tm* mozce_localtime called\n");
#endif
return mozce_localtime_r(inTimeT, &tmStorage);
}
@ -112,7 +118,9 @@ MOZCE_SHUNT_API struct tm* mozce_localtime(const time_t* inTimeT)
MOZCE_SHUNT_API struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outRetval)
{
#ifdef DEBUG
printf("tm* mozce_gmtime_r called\n");
#endif
struct tm* retval = NULL;
@ -159,7 +167,9 @@ MOZCE_SHUNT_API struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outR
MOZCE_SHUNT_API struct tm* mozce_gmtime(const time_t* inTimeT)
{
#ifdef DEBUG
printf("tm* mozce_gmtime called\n");
#endif
return mozce_gmtime_r(inTimeT, &tmStorage);
}
@ -167,7 +177,9 @@ MOZCE_SHUNT_API struct tm* mozce_gmtime(const time_t* inTimeT)
MOZCE_SHUNT_API time_t mozce_mktime(struct tm* inTM)
{
#ifdef DEBUG
printf("mozce_mktime called\n");
#endif
time_t retval = (time_t)-1;
@ -206,7 +218,9 @@ MOZCE_SHUNT_API time_t mozce_mktime(struct tm* inTM)
MOZCE_SHUNT_API time_t mozce_time(time_t* inStorage)
{
#ifdef DEBUG
printf("mozce_time called\n");
#endif
time_t retval = 0;
@ -223,7 +237,9 @@ MOZCE_SHUNT_API time_t mozce_time(time_t* inStorage)
MOZCE_SHUNT_API char* mozce_ctime(const time_t* timer)
{
#ifdef DEBUG
printf("mozce_ctime called\n");
#endif
char* retval = NULL;

Просмотреть файл

@ -49,7 +49,9 @@ extern "C" {
MOZCE_SHUNT_API int mozce_MulDiv(int inNumber, int inNumerator, int inDenominator)
{
#ifdef DEBUG
printf("mozce_MulDiv called\n");
#endif
if (inDenominator == 0)
return 0;
@ -60,7 +62,9 @@ MOZCE_SHUNT_API int mozce_MulDiv(int inNumber, int inNumerator, int inDenominato
MOZCE_SHUNT_API int mozce_GetDIBits(HDC inDC, HBITMAP inBMP, UINT inStartScan, UINT inScanLines, LPVOID inBits, LPBITMAPINFO inInfo, UINT inUsage)
{
#ifdef DEBUG
printf("-- mozce_GetDIBits called\n");
#endif
int retval = 0;
@ -72,7 +76,9 @@ MOZCE_SHUNT_API int mozce_GetDIBits(HDC inDC, HBITMAP inBMP, UINT inStartScan, U
MOZCE_SHUNT_API int mozce_SetDIBits(HDC inDC, HBITMAP inBMP, UINT inStartScan, UINT inScanLines, CONST LPVOID inBits, CONST LPBITMAPINFO inInfo, UINT inUsage)
{
#ifdef DEBUG
printf("-- mozce_SetDIBits called\n");
#endif
int retval = 0;
@ -84,17 +90,21 @@ MOZCE_SHUNT_API int mozce_SetDIBits(HDC inDC, HBITMAP inBMP, UINT inStartScan, U
MOZCE_SHUNT_API HBITMAP mozce_CreateDIBitmap(HDC inDC, CONST BITMAPINFOHEADER *inBMIH, DWORD inInit, CONST VOID *inBInit, CONST BITMAPINFO *inBMI, UINT inUsage)
{
#ifdef DEBUG
printf("-- mozce_CreateDIBitmap called\n");
#endif
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return retval;
return NULL;
}
MOZCE_SHUNT_API int mozce_SetPolyFillMode(HDC inDC, int inPolyFillMode)
{
#ifdef DEBUG
printf("-- mozce_SetPolyFillMode called\n");
#endif
int retval = 0;
@ -106,7 +116,9 @@ MOZCE_SHUNT_API int mozce_SetPolyFillMode(HDC inDC, int inPolyFillMode)
MOZCE_SHUNT_API int mozce_SetStretchBltMode(HDC inDC, int inStretchMode)
{
#ifdef DEBUG
printf("-- mozce_SetStretchBltMode called\n");
#endif
int retval = 0;
@ -118,7 +130,9 @@ MOZCE_SHUNT_API int mozce_SetStretchBltMode(HDC inDC, int inStretchMode)
MOZCE_SHUNT_API int mozce_ExtSelectClipRgn(HDC inDC, HRGN inRGN, int inMode)
{
#ifdef DEBUG
printf("-- mozce_ExtSelectClipRgn called\n");
#endif
int retval = ERROR;
@ -135,7 +149,9 @@ typedef VOID CALLBACK LINEDDAPROC(
MOZCE_SHUNT_API BOOL mozce_LineDDA(int inXStart, int inYStart, int inXEnd, int inYEnd, LINEDDAPROC inLineFunc, LPARAM inData)
{
#ifdef DEBUG
printf("-- mozce_LineDDA called\n");
#endif
BOOL retval = FALSE;
@ -147,7 +163,9 @@ MOZCE_SHUNT_API BOOL mozce_LineDDA(int inXStart, int inYStart, int inXEnd, int i
MOZCE_SHUNT_API int mozce_FrameRect(HDC inDC, CONST RECT *inRect, HBRUSH inBrush)
{
#ifdef DEBUG
printf("-- mozce_FrameRect called\n");
#endif
int retval = 0;
@ -159,7 +177,9 @@ MOZCE_SHUNT_API int mozce_FrameRect(HDC inDC, CONST RECT *inRect, HBRUSH inBrush
MOZCE_SHUNT_API int mozce_SetArcDirection(HDC inDC, int inArcDirection)
{
#ifdef DEBUG
printf("-- mozce_SetArcDirection called\n");
#endif
int retval = 0;
@ -171,7 +191,9 @@ MOZCE_SHUNT_API int mozce_SetArcDirection(HDC inDC, int inArcDirection)
MOZCE_SHUNT_API BOOL mozce_Arc(HDC inDC, int inLeftRect, int inTopRect, int inRightRect, int inBottomRect, int inXStartArc, int inYStartArc, int inXEndArc, int inYEndArc)
{
#ifdef DEBUG
printf("-- mozce_Arc called\n");
#endif
BOOL retval = FALSE;
@ -183,7 +205,9 @@ MOZCE_SHUNT_API BOOL mozce_Arc(HDC inDC, int inLeftRect, int inTopRect, int inRi
MOZCE_SHUNT_API BOOL mozce_Pie(HDC inDC, int inLeftRect, int inTopRect, int inRightRect, int inBottomRect, int inXRadial1, int inYRadial1, int inXRadial2, int inYRadial2)
{
#ifdef DEBUG
printf("-- mozce_Pie called\n");
#endif
BOOL retval = FALSE;
@ -195,15 +219,11 @@ MOZCE_SHUNT_API BOOL mozce_Pie(HDC inDC, int inLeftRect, int inTopRect, int inRi
MOZCE_SHUNT_API DWORD mozce_GetFontData(HDC inDC, DWORD inTable, DWORD inOffset, LPVOID outBuffer, DWORD inData)
{
#ifdef DEBUG
printf("-- mozce_GetFontData called\n");
#endif
DWORD retval = GDI_ERROR;
if(NULL != outBuffer && 0 < inData)
{
memset(outBuffer, 0, inData);
}
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return retval;
@ -212,7 +232,9 @@ MOZCE_SHUNT_API DWORD mozce_GetFontData(HDC inDC, DWORD inTable, DWORD inOffset,
MOZCE_SHUNT_API UINT mozce_GetTextCharset(HDC inDC)
{
#ifdef DEBUG
printf("mozce_GetTextCharset called\n");
#endif
UINT retval = DEFAULT_CHARSET;
@ -228,7 +250,9 @@ MOZCE_SHUNT_API UINT mozce_GetTextCharset(HDC inDC)
MOZCE_SHUNT_API UINT mozce_GetTextCharsetInfo(HDC inDC, LPFONTSIGNATURE outSig, DWORD inFlags)
{
#ifdef DEBUG
printf("mozce_GetTextCharsetInfo called\n");
#endif
// A broken implementation.
if(NULL != outSig)
@ -242,7 +266,9 @@ MOZCE_SHUNT_API UINT mozce_GetTextCharsetInfo(HDC inDC, LPFONTSIGNATURE outSig,
MOZCE_SHUNT_API UINT mozce_GetOutlineTextMetrics(HDC inDC, UINT inData, void* outOTM)
{
#ifdef DEBUG
printf("-- mozce_GetOutlineTextMetrics called\n");
#endif
UINT retval = 0;
@ -286,7 +312,9 @@ static int CALLBACK collectProc(CONST LOGFONT* inLF, CONST TEXTMETRIC* inTM, DWO
MOZCE_SHUNT_API int mozce_EnumFontFamiliesEx(HDC inDC, LPLOGFONT inLogfont, FONTENUMPROC inFunc, LPARAM inParam, DWORD inFlags)
{
#ifdef DEBUG
printf("mozce_EnumFontFamiliesEx called\n");
#endif
int retval = 0;
@ -321,7 +349,9 @@ MOZCE_SHUNT_API int mozce_EnumFontFamiliesEx(HDC inDC, LPLOGFONT inLogfont, FONT
MOZCE_SHUNT_API int mozce_GetMapMode(HDC inDC)
{
printf("mozce_GetMapMode called\n");
#ifdef DEBUG
printf("-- mozce_GetMapMode called\n");
#endif
int retval = -1; //MM_TEXT;
@ -331,7 +361,9 @@ MOZCE_SHUNT_API int mozce_GetMapMode(HDC inDC)
MOZCE_SHUNT_API BOOL mozce_GetIconInfo(HICON inIcon, PICONINFO outIconinfo)
{
#ifdef DEBUG
printf("-- mozce_GetIconInfo called\n");
#endif
BOOL retval = FALSE;
@ -348,7 +380,9 @@ MOZCE_SHUNT_API BOOL mozce_GetIconInfo(HICON inIcon, PICONINFO outIconinfo)
MOZCE_SHUNT_API BOOL mozce_LPtoDP(HDC inDC, LPPOINT inoutPoints, int inCount)
{
#ifdef DEBUG
printf("-- mozce_LPtoDP called\n");
#endif
BOOL retval = TRUE;
@ -358,7 +392,9 @@ MOZCE_SHUNT_API BOOL mozce_LPtoDP(HDC inDC, LPPOINT inoutPoints, int inCount)
MOZCE_SHUNT_API LONG mozce_RegCreateKey(HKEY inKey, LPCTSTR inSubKey, PHKEY outResult)
{
#ifdef DEBUG
printf("mozce_RegCreateKey called\n");
#endif
LONG retval = ERROR_SUCCESS;
DWORD disp = 0;
@ -371,7 +407,9 @@ MOZCE_SHUNT_API LONG mozce_RegCreateKey(HKEY inKey, LPCTSTR inSubKey, PHKEY outR
MOZCE_SHUNT_API BOOL mozce_WaitMessage(VOID)
{
#ifdef DEBUG
printf("mozce_WaitMessage called\n");
#endif
BOOL retval = TRUE;
@ -388,7 +426,9 @@ MOZCE_SHUNT_API BOOL mozce_WaitMessage(VOID)
MOZCE_SHUNT_API BOOL mozce_FlashWindow(HWND inWnd, BOOL inInvert)
{
#ifdef DEBUG
printf("-- mozce_FlashWindow called\n");
#endif
BOOL retval = FALSE;
@ -444,7 +484,9 @@ static BOOL ECWHelper(HWND inParent, ECWWindows* inChildren, BOOL inRecurse)
MOZCE_SHUNT_API BOOL mozce_EnumChildWindows(HWND inParent, WNDENUMPROC inFunc, LPARAM inParam)
{
#ifdef DEBUG
printf("mozce_EnumChildWindows called\n");
#endif
BOOL retval = FALSE;
@ -488,7 +530,9 @@ MOZCE_SHUNT_API BOOL mozce_EnumChildWindows(HWND inParent, WNDENUMPROC inFunc, L
MOZCE_SHUNT_API BOOL mozce_EnumThreadWindows(DWORD inThreadID, WNDENUMPROC inFunc, LPARAM inParam)
{
#ifdef DEBUG
printf("mozce_EnumThreadWindows called\n");
#endif
BOOL retval = FALSE;
@ -527,7 +571,9 @@ MOZCE_SHUNT_API BOOL mozce_EnumThreadWindows(DWORD inThreadID, WNDENUMPROC inFun
MOZCE_SHUNT_API BOOL mozce_IsIconic(HWND inWnd)
{
#ifdef DEBUG
printf("-- mozce_IsIconic called\n");
#endif
BOOL retval = FALSE;
@ -539,7 +585,9 @@ MOZCE_SHUNT_API BOOL mozce_IsIconic(HWND inWnd)
MOZCE_SHUNT_API BOOL mozce_OpenIcon(HWND inWnd)
{
#ifdef DEBUG
printf("-- mozce_OpenIcon called\n");
#endif
BOOL retval = FALSE;
@ -551,7 +599,9 @@ MOZCE_SHUNT_API BOOL mozce_OpenIcon(HWND inWnd)
MOZCE_SHUNT_API HHOOK mozce_SetWindowsHookEx(int inType, void* inFunc, HINSTANCE inMod, DWORD inThreadId)
{
#ifdef DEBUG
printf("-- mozce_SetWindowsHookEx called\n");
#endif
HHOOK retval = NULL;
@ -563,7 +613,9 @@ MOZCE_SHUNT_API HHOOK mozce_SetWindowsHookEx(int inType, void* inFunc, HINSTANCE
MOZCE_SHUNT_API BOOL mozce_UnhookWindowsHookEx(HHOOK inHook)
{
#ifdef DEBUG
printf("-- mozce_UnhookWindowsHookEx called\n");
#endif
BOOL retval = FALSE;
@ -575,7 +627,9 @@ MOZCE_SHUNT_API BOOL mozce_UnhookWindowsHookEx(HHOOK inHook)
MOZCE_SHUNT_API LRESULT mozce_CallNextHookEx(HHOOK inHook, int inCode, WPARAM wParam, LPARAM lParam)
{
#ifdef DEBUG
printf("-- mozce_CallNextHookEx called\n");
#endif
LRESULT retval = NULL;
@ -587,7 +641,9 @@ MOZCE_SHUNT_API LRESULT mozce_CallNextHookEx(HHOOK inHook, int inCode, WPARAM wP
MOZCE_SHUNT_API BOOL mozce_InvertRgn(HDC inDC, HRGN inRGN)
{
#ifdef DEBUG
printf("-- mozce_InvertRgn called\n");
#endif
BOOL retval = FALSE;
@ -599,7 +655,9 @@ MOZCE_SHUNT_API BOOL mozce_InvertRgn(HDC inDC, HRGN inRGN)
MOZCE_SHUNT_API int mozce_GetScrollPos(HWND inWnd, int inBar)
{
#ifdef DEBUG
printf("mozce_GetScrollPos called\n");
#endif
int retval = 0;
SCROLLINFO info;
@ -615,7 +673,9 @@ MOZCE_SHUNT_API int mozce_GetScrollPos(HWND inWnd, int inBar)
MOZCE_SHUNT_API BOOL mozce_GetScrollRange(HWND inWnd, int inBar, LPINT outMinPos, LPINT outMaxPos)
{
#ifdef DEBUG
printf("mozce_GetScrollRange called\n");
#endif
BOOL retval = FALSE;
SCROLLINFO info;
@ -638,7 +698,9 @@ MOZCE_SHUNT_API BOOL mozce_GetScrollRange(HWND inWnd, int inBar, LPINT outMinPos
MOZCE_SHUNT_API HRESULT mozce_CoLockObjectExternal(IUnknown* inUnk, BOOL inLock, BOOL inLastUnlockReleases)
{
#ifdef DEBUG
printf("mozce_CoLockObjectExternal called\n");
#endif
HRESULT retval = S_OK;
@ -664,7 +726,9 @@ MOZCE_SHUNT_API HRESULT mozce_CoLockObjectExternal(IUnknown* inUnk, BOOL inLock,
MOZCE_SHUNT_API HRESULT mozce_OleSetClipboard(IDataObject* inDataObj)
{
#ifdef DEBUG
printf("-- mozce_OleSetClipboard called\n");
#endif
HRESULT retval = E_NOTIMPL;
@ -676,7 +740,9 @@ MOZCE_SHUNT_API HRESULT mozce_OleSetClipboard(IDataObject* inDataObj)
MOZCE_SHUNT_API HRESULT mozce_OleGetClipboard(IDataObject** outDataObj)
{
#ifdef DEBUG
printf("-- mozce_OleGetClipboard called\n");
#endif
HRESULT retval = E_NOTIMPL;
@ -692,7 +758,9 @@ MOZCE_SHUNT_API HRESULT mozce_OleGetClipboard(IDataObject** outDataObj)
MOZCE_SHUNT_API HRESULT mozce_OleFlushClipboard(void)
{
#ifdef DEBUG
printf("-- mozce_OleFlushClipboard called\n");
#endif
HRESULT retval = E_NOTIMPL;
@ -704,7 +772,9 @@ MOZCE_SHUNT_API HRESULT mozce_OleFlushClipboard(void)
MOZCE_SHUNT_API HRESULT mozce_OleQueryLinkFromData(IDataObject* inSrcDataObject)
{
#ifdef DEBUG
printf("-- mozce_OleQueryLinkFromData called\n");
#endif
HRESULT retval = E_NOTIMPL;
@ -716,7 +786,9 @@ MOZCE_SHUNT_API HRESULT mozce_OleQueryLinkFromData(IDataObject* inSrcDataObject)
//LPITEMIDLIST
MOZCE_SHUNT_API void* mozce_SHBrowseForFolder(void* /*LPBROWSEINFOS*/ inBI)
{
#ifdef DEBUG
printf("-- mozce_SHBrowseForFolder called\n");
#endif
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return NULL;
@ -725,19 +797,19 @@ MOZCE_SHUNT_API void* mozce_SHBrowseForFolder(void* /*LPBROWSEINFOS*/ inBI)
MOZCE_SHUNT_API BOOL mozce_SetMenu(HWND inWnd, HMENU inMenu)
{
#ifdef DEBUG
printf("-- mozce_SetMenu called\n");
BOOL retval = FALSE;
#endif
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return retval;
return FALSE;
}
MOZCE_SHUNT_API BOOL mozce_GetUserName(LPTSTR inBuffer, LPDWORD inoutSize)
{
#ifdef DEBUG
printf("-- mozce_GetUserName called\n");
#endif
BOOL retval = FALSE;
@ -750,7 +822,9 @@ MOZCE_SHUNT_API BOOL mozce_GetUserName(LPTSTR inBuffer, LPDWORD inoutSize)
MOZCE_SHUNT_API DWORD mozce_GetShortPathName(LPCTSTR inLongPath, LPTSTR outShortPath, DWORD inBufferSize)
{
#ifdef DEBUG
printf("-- mozce_GetShortPathName called\n");
#endif
DWORD retval = 0;
@ -761,7 +835,9 @@ MOZCE_SHUNT_API DWORD mozce_GetShortPathName(LPCTSTR inLongPath, LPTSTR outShort
MOZCE_SHUNT_API DWORD mozce_GetEnvironmentVariable(LPCTSTR lpName, LPSTR lpBuffer, DWORD nSize)
{
#ifdef DEBUG
printf("-- mozce_GetEnvironmentVariable called\n");
#endif
DWORD retval = 0;
@ -772,7 +848,9 @@ MOZCE_SHUNT_API DWORD mozce_GetEnvironmentVariable(LPCTSTR lpName, LPSTR lpBuffe
MOZCE_SHUNT_API void mozce_GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime)
{
#ifdef DEBUG
printf("mozce_GetSystemTimeAsFileTime called\n");
#endif
SYSTEMTIME st;
GetSystemTime(&st);
@ -803,31 +881,41 @@ struct lconv s_locale_conv =
MOZCE_SHUNT_API struct lconv * mozce_localeconv(void)
{
#ifdef DEBUG
printf("mozce_localeconv called\n");
#endif
return &s_locale_conv;
}
MOZCE_SHUNT_API DWORD mozce_GetCurrentThreadId(void)
{
#ifdef DEBUG
printf("mozce_GetCurrentThreadId called\n");
#endif
return GetCurrentThreadId();
}
MOZCE_SHUNT_API DWORD mozce_TlsAlloc(void)
{
#ifdef DEBUG
printf("mozce_TlsAlloc called\n");
#endif
return TlsAlloc();
}
MOZCE_SHUNT_API BOOL mozce_TlsFree(DWORD dwTlsIndex)
{
#ifdef DEBUG
printf("mozce_TlsFree called\n");
#endif
return TlsFree(dwTlsIndex);
}
MOZCE_SHUNT_API HANDLE mozce_GetCurrentProcess(void)
{
#ifdef DEBUG
printf("mozce_GetCurrentProcess called\n");
#endif
return GetCurrentProcess();
}
@ -859,7 +947,9 @@ MOZCE_SHUNT_API DWORD mozce_GetFullPathName(LPCSTR lpFileName,
*lpFilePart = lpBuffer;
}
#ifdef DEBUG
printf("mozce_GetFullPathName called %s (%s)\n", lpBuffer, *lpFilePart);
#endif
return len;
}

Просмотреть файл

@ -42,13 +42,17 @@ extern "C" {
}
#endif
#define IS_INTRESOURCE(_r) (((ULONG_PTR)(_r) >> 16) == 0)
/*
** Help figure the character count of a TCHAR array.
*/
MOZCE_SHUNT_API DWORD mozce_GetModuleFileNameA(HMODULE hModule, LPSTR lpFilename, DWORD nSize)
{
#ifdef DEBUG
printf("mozce_GetModuleFileNameA called\n");
#endif
TCHAR wideStr[MAX_PATH];
@ -64,7 +68,9 @@ MOZCE_SHUNT_API DWORD mozce_GetModuleFileNameA(HMODULE hModule, LPSTR lpFilename
MOZCE_SHUNT_API BOOL mozce_CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
{
#ifdef DEBUG
printf("mozce_CreateDirectoryA called (%s)\n", lpPathName);
#endif
BOOL retval = FALSE;
TCHAR wideStr[MAX_PATH];
@ -79,7 +85,9 @@ MOZCE_SHUNT_API BOOL mozce_CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIB
MOZCE_SHUNT_API BOOL mozce_RemoveDirectoryA(LPCSTR lpPathName)
{
#ifdef DEBUG
printf("mozce_RemoveDirectoryA called\n");
#endif
BOOL retval = FALSE;
TCHAR wideStr[MAX_PATH];
@ -93,7 +101,9 @@ MOZCE_SHUNT_API BOOL mozce_RemoveDirectoryA(LPCSTR lpPathName)
MOZCE_SHUNT_API BOOL mozce_DeleteFileA(LPCSTR lpFileName)
{
#ifdef DEBUG
printf("mozce_DeleteFile called\n");
#endif
BOOL retval = FALSE;
TCHAR wideStr[MAX_PATH];
@ -107,7 +117,9 @@ MOZCE_SHUNT_API BOOL mozce_DeleteFileA(LPCSTR lpFileName)
MOZCE_SHUNT_API BOOL mozce_MoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName)
{
#ifdef DEBUG
printf("mozce_MoveFileA called (%s)\n", lpExistingFileName);
#endif
BOOL retval = FALSE;
TCHAR wideStr[2][MAX_PATH];
@ -123,7 +135,9 @@ MOZCE_SHUNT_API BOOL mozce_MoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFile
MOZCE_SHUNT_API BOOL mozce_CopyFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, BOOL bFailIfExists)
{
#ifdef DEBUG
printf("mozce_CopyFileA called\n");
#endif
BOOL retval = FALSE;
TCHAR wideStr[2][MAX_PATH];
@ -135,15 +149,15 @@ MOZCE_SHUNT_API BOOL mozce_CopyFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFile
{
retval = CopyFileW(wideStr[0], wideStr[1], bFailIfExists);
}
printf("CopyFileA\n");
return retval;
}
MOZCE_SHUNT_API HANDLE mozce_CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{
#ifdef DEBUG
printf("mozce_CreateFileA called (%s)\n", lpFileName);
#endif
HANDLE retval = INVALID_HANDLE_VALUE;
TCHAR wideStr[MAX_PATH];
@ -164,7 +178,9 @@ MOZCE_SHUNT_API HANDLE mozce_CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAcces
MOZCE_SHUNT_API DWORD mozce_GetFileAttributesA(LPCSTR lpFileName)
{
#ifdef DEBUG
printf("mozce_GetFileAttributesA called\n");
#endif
DWORD retval = (DWORD)-1;
TCHAR wideStr[MAX_PATH];
@ -174,13 +190,14 @@ MOZCE_SHUNT_API DWORD mozce_GetFileAttributesA(LPCSTR lpFileName)
retval = GetFileAttributesW(wideStr);
}
printf("GetFileAttributesA\n");
return retval;
}
MOZCE_SHUNT_API BOOL mozce_CreateProcessA(LPCSTR pszImageName, LPCSTR pszCmdLine, LPSECURITY_ATTRIBUTES psaProcess, LPSECURITY_ATTRIBUTES psaThread, BOOL fInheritHandles, DWORD fdwCreate, LPVOID pvEnvironment, LPSTR pszCurDir, LPSTARTUPINFO psiStartInfo, LPPROCESS_INFORMATION pProcInfo)
{
#ifdef DEBUG
printf("mozce_CreateProcessA called\n");
#endif
BOOL retval = FALSE;
TCHAR pszImageNameW[MAX_PATH];
@ -207,7 +224,9 @@ MOZCE_SHUNT_API BOOL mozce_CreateProcessA(LPCSTR pszImageName, LPCSTR pszCmdLine
MOZCE_SHUNT_API int mozce_GetLocaleInfoA(LCID Locale, LCTYPE LCType, LPSTR lpLCData, int cchData)
{
#ifdef DEBUG
printf("mozce_GetLocaleInfoA called\n");
#endif
int retval = 0;
int neededChars = 0;
@ -254,7 +273,9 @@ MOZCE_SHUNT_API int mozce_GetLocaleInfoA(LCID Locale, LCTYPE LCType, LPSTR lpLCD
MOZCE_SHUNT_API UINT mozce_GetWindowsDirectoryA(LPSTR inBuffer, UINT inSize)
{
#ifdef DEBUG
printf("mozce_GetWindowsDirectoryA called\n");
#endif
UINT retval = 0;
@ -268,14 +289,15 @@ MOZCE_SHUNT_API UINT mozce_GetWindowsDirectoryA(LPSTR inBuffer, UINT inSize)
retval = 8;
}
printf("GetWindowsDirectoryA\n");
return retval;
}
MOZCE_SHUNT_API UINT mozce_GetSystemDirectoryA(LPSTR inBuffer, UINT inSize)
{
#ifdef DEBUG
printf("mozce_GetSystemDirectoryA called\n");
#endif
UINT retval = 0;
@ -288,14 +310,14 @@ MOZCE_SHUNT_API UINT mozce_GetSystemDirectoryA(LPSTR inBuffer, UINT inSize)
strcpy(inBuffer, "\\WINDOWS");
retval = 8;
}
printf("GetSystemDirectoryA\n");
return retval;
}
MOZCE_SHUNT_API LONG mozce_RegOpenKeyExA(HKEY inKey, LPCSTR inSubKey, DWORD inOptions, REGSAM inSAM, PHKEY outResult)
{
#ifdef DEBUG
printf("mozce_RegOpenKeyExA called\n");
#endif
LONG retval = ERROR_GEN_FAILURE;
@ -305,15 +327,15 @@ MOZCE_SHUNT_API LONG mozce_RegOpenKeyExA(HKEY inKey, LPCSTR inSubKey, DWORD inOp
retval = RegOpenKeyEx(inKey, wSubKey, inOptions, inSAM, outResult);
free(wSubKey);
}
printf("RegOpenKeyExA\n");
return retval;
}
MOZCE_SHUNT_API LONG mozce_RegQueryValueExA(HKEY inKey, LPCSTR inValueName, LPDWORD inReserved, LPDWORD outType, LPBYTE inoutBData, LPDWORD inoutDData)
{
#ifdef DEBUG
printf("mozce_RegQueryValueExA called\n");
#endif
LONG retval = ERROR_GEN_FAILURE;
@ -349,13 +371,14 @@ MOZCE_SHUNT_API LONG mozce_RegQueryValueExA(HKEY inKey, LPCSTR inValueName, LPDW
free(wName);
}
printf("RegQueryValueExA\n");
return retval;
}
MOZCE_SHUNT_API int mozce_MessageBoxA(HWND inWnd, LPCSTR inText, LPCSTR inCaption, UINT uType)
{
#ifdef DEBUG
printf("mozce_MessageBoxA called\n");
#endif
int retval = 0;
LPTSTR wCaption = a2w_malloc(inCaption, -1, NULL);
@ -378,7 +401,9 @@ MOZCE_SHUNT_API int mozce_MessageBoxA(HWND inWnd, LPCSTR inText, LPCSTR inCaptio
MOZCE_SHUNT_API HANDLE mozce_OpenSemaphoreA(DWORD inDesiredAccess, BOOL inInheritHandle, LPCSTR inName)
{
#ifdef DEBUG
printf("mozce_OpenSemaphoreA called\n");
#endif
HANDLE retval = NULL;
LPTSTR wName = a2w_malloc(inName, -1, NULL);
@ -390,14 +415,15 @@ MOZCE_SHUNT_API HANDLE mozce_OpenSemaphoreA(DWORD inDesiredAccess, BOOL inInheri
free(wName);
}
printf("OpenSemaphoreA\n");
return retval;
}
MOZCE_SHUNT_API HDC mozce_CreateDCA(LPCSTR inDriver, LPCSTR inDevice, LPCSTR inOutput, CONST DEVMODEA* inInitData)
{
#ifdef DEBUG
printf("mozce_CreateDCA called\n");
#endif
HDC retval = NULL;
@ -454,14 +480,15 @@ MOZCE_SHUNT_API HDC mozce_CreateDCA(LPCSTR inDriver, LPCSTR inDevice, LPCSTR inO
wOutput = NULL;
}
printf("_CreateDCA\n");
return retval;
}
MOZCE_SHUNT_API HDC mozce_CreateDCA2(LPCSTR inDriver, LPCSTR inDevice, LPCSTR inOutput, CONST DEVMODE* inInitData)
{
#ifdef DEBUG
printf("mozce_CreateDCA2 called\n");
#endif
HDC retval = NULL;
@ -487,14 +514,14 @@ MOZCE_SHUNT_API HDC mozce_CreateDCA2(LPCSTR inDriver, LPCSTR inDevice, LPCSTR in
wOutput = NULL;
}
printf("_CreateDCA2\n");
return retval;
}
MOZCE_SHUNT_API BOOL mozce_GetTextExtentExPointA(HDC inDC, LPCSTR inStr, int inLen, int inMaxExtent, LPINT outFit, LPINT outDx, LPSIZE inSize)
MOZCE_SHUNT_API BOOL mozce_GetTextExtentExPointA(HDC inDC, char* inStr, int inLen, int inMaxExtent, LPINT outFit, LPINT outDx, LPSIZE inSize)
{
#ifdef DEBUG
printf("mozce_GetTextExtentExPointA called\n");
#endif
BOOL retval = FALSE;
@ -504,6 +531,8 @@ MOZCE_SHUNT_API BOOL mozce_GetTextExtentExPointA(HDC inDC, LPCSTR inStr, int inL
if(inLen == -1)
inLen = strlen(inStr);
inStr[inLen] = '\0';
int wLen = 0;
LPTSTR wStr = a2w_malloc(inStr, inLen, &wLen);
@ -513,13 +542,16 @@ MOZCE_SHUNT_API BOOL mozce_GetTextExtentExPointA(HDC inDC, LPCSTR inStr, int inL
free(wStr);
}
return retval;
}
MOZCE_SHUNT_API BOOL mozce_ExtTextOutA(HDC inDC, int inX, int inY, UINT inOptions, const LPRECT inRect, LPCSTR inString, UINT inCount, const LPINT inDx)
{
#ifdef DEBUG
printf("mozce_ExtTextOutA called\n");
#endif
BOOL retval = false;
@ -534,24 +566,26 @@ MOZCE_SHUNT_API BOOL mozce_ExtTextOutA(HDC inDC, int inX, int inY, UINT inOption
wStr = NULL;
}
printf("_ExtTextOutA\n");
return retval;
}
MOZCE_SHUNT_API DWORD mozce_GetGlyphOutlineA(HDC inDC, CHAR inChar, UINT inFormat, void* inGM, DWORD inBufferSize, LPVOID outBuffer, CONST mozce_MAT2* inMAT2)
{
#ifdef DEBUG
printf("-- mozce_GetGlyphOutlineA called\n");
#endif
DWORD retval = GDI_ERROR;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
printf("GetGlyphOutlineA\n");
return retval;
}
MOZCE_SHUNT_API DWORD mozce_GetCurrentDirectoryA(DWORD inBufferLength, LPSTR outBuffer)
{
#ifdef DEBUG
printf("-- mozce_GetCurrentDirectoryA called\n");
#endif
DWORD retval = 0;
@ -567,7 +601,9 @@ MOZCE_SHUNT_API DWORD mozce_GetCurrentDirectoryA(DWORD inBufferLength, LPSTR out
MOZCE_SHUNT_API BOOL mozce_SetCurrentDirectoryA(LPCSTR inPathName)
{
#ifdef DEBUG
printf("-- mozce_SetCurrentDirectoryA called\n");
#endif
BOOL retval = FALSE;
@ -577,7 +613,9 @@ MOZCE_SHUNT_API BOOL mozce_SetCurrentDirectoryA(LPCSTR inPathName)
MOZCE_SHUNT_API LONG mozce_RegEnumKeyExA(HKEY inKey, DWORD inIndex, LPSTR outName, LPDWORD inoutName, LPDWORD inReserved, LPSTR outClass, LPDWORD inoutClass, PFILETIME inLastWriteTime)
{
#ifdef DEBUG
printf("mozce_RegEnumKeyExA called\n");
#endif
LONG retval = ERROR_NOT_ENOUGH_MEMORY;
@ -620,7 +658,9 @@ MOZCE_SHUNT_API LONG mozce_RegEnumKeyExA(HKEY inKey, DWORD inIndex, LPSTR outNam
MOZCE_SHUNT_API BOOL mozce_GetFileVersionInfoA(LPSTR inFilename, DWORD inHandle, DWORD inLen, LPVOID outData)
{
#ifdef DEBUG
printf("mozce_GetFileVersionInfoA called\n");
#endif
BOOL retval = FALSE;
TCHAR wPath[MAX_PATH];
@ -635,7 +675,9 @@ MOZCE_SHUNT_API BOOL mozce_GetFileVersionInfoA(LPSTR inFilename, DWORD inHandle,
MOZCE_SHUNT_API DWORD mozce_GetFileVersionInfoSizeA(LPSTR inFilename, LPDWORD outHandle)
{
#ifdef DEBUG
printf("mozce_GetFileVersionInfoSizeA called\n");
#endif
DWORD retval = 0;
@ -651,7 +693,9 @@ MOZCE_SHUNT_API DWORD mozce_GetFileVersionInfoSizeA(LPSTR inFilename, LPDWORD ou
MOZCE_SHUNT_API BOOL mozce_VerQueryValueA(const LPVOID inBlock, LPSTR inSubBlock, LPVOID *outBuffer, PUINT outLen)
{
#ifdef DEBUG
printf("mozce_VerQueryValueA called\n");
#endif
BOOL retval = FALSE;
LPTSTR wBlock = NULL;
@ -668,7 +712,9 @@ MOZCE_SHUNT_API BOOL mozce_VerQueryValueA(const LPVOID inBlock, LPSTR inSubBlock
MOZCE_SHUNT_API int mozce_LoadStringA(HINSTANCE inInstance, UINT inID, LPSTR outBuffer, int inBufferMax)
{
#ifdef DEBUG
printf("mozce_LoadStringA called\n");
#endif
int retval = 0;
@ -692,7 +738,9 @@ MOZCE_SHUNT_API int mozce_LoadStringA(HINSTANCE inInstance, UINT inID, LPSTR out
MOZCE_SHUNT_API VOID mozce_OutputDebugStringA(LPCSTR inOutputString)
{
#ifdef DEBUG
printf("mozce_OutputDebugStringA called\n");
#endif
LPTSTR wideStr = NULL;
@ -707,7 +755,9 @@ MOZCE_SHUNT_API VOID mozce_OutputDebugStringA(LPCSTR inOutputString)
MOZCE_SHUNT_API int mozce_DrawTextA(HDC inDC, LPCSTR inString, int inCount, LPRECT inRect, UINT inFormat)
{
#ifdef DEBUG
printf("mozce_DrawTextA called\n");
#endif
int retval = 0;
int wStringLen = 0;
@ -724,7 +774,9 @@ MOZCE_SHUNT_API int mozce_DrawTextA(HDC inDC, LPCSTR inString, int inCount, LPRE
MOZCE_SHUNT_API BOOL mozce_SetDlgItemTextA(HWND inDlg, int inIDDlgItem, LPCSTR inString)
{
#ifdef DEBUG
printf("mozce_SetDlgItemTextA called\n");
#endif
BOOL retval = FALSE;
LPTSTR wString = a2w_malloc(inString, -1, NULL);
@ -740,7 +792,9 @@ MOZCE_SHUNT_API BOOL mozce_SetDlgItemTextA(HWND inDlg, int inIDDlgItem, LPCSTR i
MOZCE_SHUNT_API HANDLE mozce_LoadImageA(HINSTANCE inInst, LPCSTR inName, UINT inType, int inCX, int inCY, UINT inLoad)
{
#ifdef DEBUG
printf("mozce_LoadImageA called\n");
#endif
HANDLE retval = NULL;
@ -757,7 +811,9 @@ MOZCE_SHUNT_API HANDLE mozce_LoadImageA(HINSTANCE inInst, LPCSTR inName, UINT in
MOZCE_SHUNT_API HWND mozce_FindWindowA(LPCSTR inClass, LPCSTR inWindow)
{
#ifdef DEBUG
printf("mozce_FindWindowA called\n");
#endif
HWND retval = NULL;
@ -786,7 +842,9 @@ MOZCE_SHUNT_API HWND mozce_FindWindowA(LPCSTR inClass, LPCSTR inWindow)
MOZCE_SHUNT_API UINT mozce_RegisterClipboardFormatA(LPCSTR inFormat)
{
#ifdef DEBUG
printf("mozce_RegisterClipboardFormatA called\n");
#endif
UINT retval = 0;
@ -803,32 +861,36 @@ MOZCE_SHUNT_API UINT mozce_RegisterClipboardFormatA(LPCSTR inFormat)
MOZCE_SHUNT_API DWORD mozce_GetEnvironmentVariableA(LPSTR lpName, LPSTR lpBuffer, DWORD nSize)
{
#ifdef DEBUG
printf("-- mozce_GetEnvironmentVariableA called\n");
#endif
DWORD retval = -1;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
printf("mozce_GetEnvironmentVariableA\n");
return retval;
}
MOZCE_SHUNT_API DWORD mozce_SetEnvironmentVariableA(LPSTR lpName, LPSTR lpBuffer)
{
#ifdef DEBUG
printf("-- mozce_SetEnvironmentVariableA called\n");
#endif
DWORD retval = -1;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
printf("mozce_SetEnvironmentVariableA\n");
return retval;
}
MOZCE_SHUNT_API LRESULT mozce_SendMessageA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
#ifdef DEBUG
printf("mozce_SendMessageA called\n");
#endif
wchar_t *lpNewText = NULL;
LRESULT res;
@ -861,7 +923,9 @@ MOZCE_SHUNT_API LRESULT mozce_SendMessageA(HWND hWnd, UINT msg, WPARAM wParam, L
else
{
// need possible conversion??
#ifdef DEBUG
printf(" need possible conversion %d\n", msg);
#endif
}
#endif
@ -881,7 +945,9 @@ MOZCE_SHUNT_API LRESULT mozce_SendMessageA(HWND hWnd, UINT msg, WPARAM wParam, L
}
else
{
#ifdef DEBUG
printf(" need possible out conversion %d\n", msg);
#endif
}
#endif
@ -894,7 +960,9 @@ MOZCE_SHUNT_API LRESULT mozce_SendMessageA(HWND hWnd, UINT msg, WPARAM wParam, L
MOZCE_SHUNT_API ATOM mozce_GlobalAddAtomA(LPCSTR lpString)
{
#ifdef DEBUG
printf("mozce_GlobalAddAtomA called (%s)\n", lpString);
#endif
LPTSTR watom = a2w_malloc(lpString, -1, NULL);
if (!watom)
@ -903,21 +971,23 @@ MOZCE_SHUNT_API ATOM mozce_GlobalAddAtomA(LPCSTR lpString)
ATOM a = GlobalAddAtomW(watom);
free(watom);
printf("returning %x\n", a);
return a;
}
MOZCE_SHUNT_API LRESULT mozce_PostMessageA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
#ifdef DEBUG
printf("mozce_PostMessageA called\n");
#endif
return PostMessageW(hWnd, msg, wParam, lParam);
}
MOZCE_SHUNT_API BOOL mozce_GetVersionExA(LPOSVERSIONINFOA lpv)
{
#ifdef DEBUG
printf("mozce_GetVersionExA called\n");
#endif
OSVERSIONINFOW vw;
vw.dwOSVersionInfoSize = sizeof(vw);
@ -933,7 +1003,9 @@ MOZCE_SHUNT_API BOOL mozce_GetVersionExA(LPOSVERSIONINFOA lpv)
MOZCE_SHUNT_API BOOL mozce_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
{
#ifdef LOUD_PEEKMESSAGE
#ifdef DEBUG
printf("mozce_PeekMessageA called\n");
#endif
#endif
return PeekMessageW(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
@ -942,7 +1014,9 @@ MOZCE_SHUNT_API BOOL mozce_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterM
MOZCE_SHUNT_API LRESULT mozce_DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
#ifdef DEBUG
printf("mozce_DefWindowProcA called\n");
#endif
return DefWindowProcW(hWnd, Msg, wParam, lParam);
}
@ -1003,7 +1077,9 @@ MOZCE_SHUNT_API HWND mozce_CreateWindowExA(DWORD dwExStyle,
MOZCE_SHUNT_API ATOM mozce_RegisterClassA(CONST WNDCLASSA *lpwc)
{
#ifdef DEBUG
printf("mozce_RegisterClassA called (%s)\n", lpwc->lpszClassName);
#endif
WNDCLASSW wcW;
@ -1017,7 +1093,9 @@ MOZCE_SHUNT_API ATOM mozce_RegisterClassA(CONST WNDCLASSA *lpwc)
MOZCE_SHUNT_API UINT mozce_RegisterWindowMessageA(LPCSTR s)
{
#ifdef DEBUG
printf("mozce_RegisterWindowMessageA called\n");
#endif
LPTSTR w = a2w_malloc(s, -1, NULL);
UINT result = RegisterWindowMessageW(w);
@ -1028,7 +1106,9 @@ MOZCE_SHUNT_API UINT mozce_RegisterWindowMessageA(LPCSTR s)
MOZCE_SHUNT_API BOOL mozce_GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASS lpWndClass)
{
#ifdef DEBUG
printf("mozce_GetClassInfoA called\n");
#endif
LPTSTR wClassName = a2w_malloc(lpClassName, -1, NULL);
BOOL result = GetClassInfoW(hInstance, wClassName, lpWndClass);
@ -1039,26 +1119,33 @@ MOZCE_SHUNT_API BOOL mozce_GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName
MOZCE_SHUNT_API HINSTANCE mozce_LoadLibraryA(LPCSTR lpLibFileName)
{
#ifdef DEBUG
printf("mozce_LoadLibraryA called (%s)\n", lpLibFileName);
#endif
HINSTANCE retval = NULL;
TCHAR wPath[MAX_PATH];
if(0 != a2w_buffer(lpLibFileName, -1, wPath, charcount(wPath)))
{
LPTSTR wPath = a2w_malloc(lpLibFileName, -1, NULL);
if(wPath) {
retval = LoadLibraryW(wPath);
free(wPath);
}
if (retval == NULL)
printf(" FAILED!!\n");
#ifdef DEBUG
if (!retval) {
printf("LoadLibraryA failure! %d\n", GetLastError());
}
#endif
return retval;
}
MOZCE_SHUNT_API int mozce_GetObjectA(HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject)
{
#ifdef DEBUG
printf("mozce_GetObjectA called\n");
#endif
if(cbBuffer == sizeof(LOGFONTA))
{
@ -1078,22 +1165,28 @@ MOZCE_SHUNT_API int mozce_GetObjectA(HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvOb
MOZCE_SHUNT_API FARPROC mozce_GetProcAddressA(HMODULE hMod, const char *name)
{
#ifdef DEBUG
printf("mozce_GetProcAddressA called (%s)\n", name);
#endif
LPTSTR wName = a2w_malloc(name, -1, NULL);
FARPROC p = GetProcAddressW(hMod, wName);
free(wName);
if (p == NULL)
printf(" FAILED!!\n");
#ifdef DEBUG
if (!p)
printf("NOT FOUND!!!!!!\n");
#endif
free(wName);
return p;
}
MOZCE_SHUNT_API HCURSOR mozce_LoadCursorA(HINSTANCE hInstance, LPCSTR lpCursorName)
{
#ifdef DEBUG
printf("mozce_LoadCursorA called\n");
#endif
wchar_t *lpCursorNameW;
HCURSOR hc;
@ -1118,7 +1211,9 @@ MOZCE_SHUNT_API HCURSOR mozce_LoadCursorA(HINSTANCE hInstance, LPCSTR lpCursorNa
MOZCE_SHUNT_API int mozce_GetClassNameA(HWND hWnd, LPTSTR lpClassName, int nMaxCount)
{
#ifdef DEBUG
printf("mozce_GetClassNameA called\n");
#endif
WCHAR classNameW[126];
int res;
@ -1134,7 +1229,9 @@ MOZCE_SHUNT_API int mozce_GetClassNameA(HWND hWnd, LPTSTR lpClassName, int nMaxC
MOZCE_SHUNT_API BOOL mozce_GetOpenFileNameA(LPOPENFILENAMEA lpofna)
{
#ifdef DEBUG
printf("-- mozce_GetOpenFileNameA called\n");
#endif
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
@ -1142,7 +1239,9 @@ MOZCE_SHUNT_API BOOL mozce_GetOpenFileNameA(LPOPENFILENAMEA lpofna)
MOZCE_SHUNT_API BOOL mozce_GetSaveFileNameA(LPOPENFILENAMEA lpofna)
{
#ifdef DEBUG
printf("-- mozce_GetSaveFileNameA called\n");
#endif
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
@ -1151,7 +1250,9 @@ MOZCE_SHUNT_API BOOL mozce_GetSaveFileNameA(LPOPENFILENAMEA lpofna)
MOZCE_SHUNT_API HMODULE mozce_GetModuleHandleA(const char *lpName)
{
#ifdef DEBUG
printf("mozce_GetModuleHandleA called (%s)\n", lpName);
#endif
if (lpName == NULL)
return GetModuleHandleW(NULL);
@ -1160,13 +1261,14 @@ MOZCE_SHUNT_API HMODULE mozce_GetModuleHandleA(const char *lpName)
if(a2w_buffer(lpName, -1, wideStr, charcount(wideStr)))
return GetModuleHandleW(wideStr);
printf(" FAILED!!\n");
return NULL;
}
MOZCE_SHUNT_API HICON mozce_LoadIconA(HINSTANCE hInstance, LPCSTR lpIconName)
{
#ifdef DEBUG
printf("mozce_LoadIconA called\n");
#endif
HICON hi = NULL;
@ -1178,8 +1280,6 @@ MOZCE_SHUNT_API HICON mozce_LoadIconA(HINSTANCE hInstance, LPCSTR lpIconName)
return hi;
}
#define IS_INTRESOURCE(_r) (((ULONG_PTR)(_r) >> 16) == 0)
MOZCE_SHUNT_API HRSRC mozce_FindResourceA(HMODULE hModule, LPCSTR lpName, LPCSTR lpType)
{
HRSRC hr;
@ -1197,33 +1297,37 @@ MOZCE_SHUNT_API HRSRC mozce_FindResourceA(HMODULE hModule, LPCSTR lpName, LPCS
hr = FindResourceW(hModule, (const unsigned short*)lpName, (const unsigned short*)lpType);
}
#ifdef DEBUG
if (hr == NULL)
printf("hr == %d\n", GetLastError());
#endif
return hr;
}
MOZCE_SHUNT_API UINT mozce_GetDlgItemTextA(HWND hDlg, int nIDDlgItem, LPSTR lpString, int nMaxCount)
{
#ifdef DEBUG
printf("mozce_GetDlgItemTextA called\n");
#endif
LPWSTR lpStringW;
UINT res;
lpStringW = (unsigned short*)_alloca((nMaxCount + 1) * 2);
LPWSTR stringW = (unsigned short*) malloc ((nMaxCount + 1) * 2);
res = GetDlgItemTextW(hDlg, nIDDlgItem, lpStringW, nMaxCount);
res = GetDlgItemTextW(hDlg, nIDDlgItem, stringW, nMaxCount);
if(res >= 0)
{
WideCharToMultiByte(CP_ACP, 0, lpStringW, -1, lpString,
nMaxCount, NULL, NULL);
}
w2a_buffer(stringW, -1, lpString, nMaxCount);
free(stringW);
return res;
}
MOZCE_SHUNT_API HANDLE mozce_CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, const char *lpName)
{
#ifdef DEBUG
printf("mozce_CreateEventA called\n");
#endif
HANDLE hEvent;
wchar_t *lpNameNew = NULL;
@ -1246,7 +1350,9 @@ MOZCE_SHUNT_API HANDLE mozce_CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttribute
MOZCE_SHUNT_API HMENU mozce_LoadMenuA(HINSTANCE hInstance, LPCSTR lpMenuName)
{
#ifdef DEBUG
printf("mozce_LoadMenuA called\n");
#endif
HMENU hr;
if (! IS_INTRESOURCE(lpMenuName))
@ -1267,10 +1373,15 @@ MOZCE_SHUNT_API HMENU mozce_LoadMenuA(HINSTANCE hInstance, LPCSTR lpMenuName)
MOZCE_SHUNT_API HANDLE mozce_GetPropA(HWND hWnd, LPCSTR lpString)
{
#ifdef DEBUG
printf("mozce_GetPropA called\n");
#endif
HANDLE h = NULL;
if (IS_INTRESOURCE(lpString))
return GetProp(hWnd, (const unsigned short *)lpString);
LPTSTR wString = a2w_malloc(lpString, -1, NULL);
if (wString) {
h = GetProp(hWnd, wString);
@ -1281,9 +1392,16 @@ MOZCE_SHUNT_API HANDLE mozce_GetPropA(HWND hWnd, LPCSTR lpString)
MOZCE_SHUNT_API BOOL mozce_SetPropA(HWND hWnd, LPCSTR lpString, HANDLE hData)
{
#ifdef DEBUG
printf("mozce_SetPropA called\n");
#endif
BOOL b = FALSE;
if (!lpString)
return b;
if (IS_INTRESOURCE(lpString))
return SetProp(hWnd, (const unsigned short *)lpString, hData);
LPTSTR wString = a2w_malloc(lpString, -1, NULL);
if (wString) {
@ -1295,10 +1413,15 @@ MOZCE_SHUNT_API BOOL mozce_SetPropA(HWND hWnd, LPCSTR lpString, HANDLE hData)
MOZCE_SHUNT_API HANDLE mozce_RemovePropA(HWND hWnd, LPCSTR lpString)
{
#ifdef DEBUG
printf("mozce_RemovePropA called\n");
#endif
HANDLE h = NULL;
if (IS_INTRESOURCE(lpString))
return RemoveProp(hWnd, (const unsigned short *)lpString);
LPTSTR wString = a2w_malloc(lpString, -1, NULL);
if (wString) {
h = RemoveProp(hWnd, wString);
@ -1310,7 +1433,9 @@ MOZCE_SHUNT_API HANDLE mozce_RemovePropA(HWND hWnd, LPCSTR lpString)
MOZCE_SHUNT_API HANDLE mozce_FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData)
{
#ifdef DEBUG
printf("mozce_FindFirstFileA called\n");
#endif
HANDLE h = NULL;
if (!lpFindFileData || !lpFileName)
@ -1344,7 +1469,9 @@ MOZCE_SHUNT_API HANDLE mozce_FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA
MOZCE_SHUNT_API BOOL mozce_FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData)
{
#ifdef DEBUG
printf("mozce_FindNextFileA called\n");
#endif
WIN32_FIND_DATAW findData;
@ -1377,7 +1504,9 @@ MOZCE_SHUNT_API BOOL mozce_FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lp
MOZCE_SHUNT_API HANDLE mozce_CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName)
{
#ifdef DEBUG
printf("mozce_CreateFileMappingA called\n");
#endif
HANDLE h = NULL;
@ -1391,7 +1520,9 @@ MOZCE_SHUNT_API HANDLE mozce_CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBU
MOZCE_SHUNT_API DWORD mozce_FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, va_list* Arguments)
{
#ifdef DEBUG
printf("mozce_FormatMessageA called\n");
#endif
DWORD d = -1;
LPTSTR wString = a2w_malloc(lpBuffer, nSize, NULL);
@ -1404,7 +1535,9 @@ MOZCE_SHUNT_API DWORD mozce_FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWOR
MOZCE_SHUNT_API HANDLE mozce_CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName)
{
#ifdef DEBUG
printf("mozce_CreateSemaphoreA called\n");
#endif
HANDLE h = NULL;
@ -1421,7 +1554,9 @@ MOZCE_SHUNT_API HANDLE mozce_CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreA
MOZCE_SHUNT_API int mozce_StartDocA(HDC hdc, CONST DOCINFO* lpdi)
{
#ifdef DEBUG
printf("-- mozce_StartDocA called\n");
#endif
DWORD retval = GDI_ERROR;
@ -1432,7 +1567,9 @@ MOZCE_SHUNT_API int mozce_StartDocA(HDC hdc, CONST DOCINFO* lpdi)
MOZCE_SHUNT_API HFONT mozce_CreateFontIndirectA(CONST LOGFONTA* lplf)
{
#ifdef DEBUG
printf("mozce_CreateFontIndirectA called\n");
#endif
LOGFONTW lfw;
HFONT hFont;
@ -1451,41 +1588,57 @@ MOZCE_SHUNT_API HFONT mozce_CreateFontIndirectA(CONST LOGFONTA* lplf)
lfw.lfQuality = lplf->lfQuality;
lfw.lfPitchAndFamily = lplf->lfPitchAndFamily;
a2w_buffer(lplf->lfFaceName, -1, lfw.lfFaceName, charcount(lfw.lfFaceName));
a2w_buffer(lplf->lfFaceName, -1, lfw.lfFaceName, LF_FACESIZE);
hFont = CreateFontIndirectW(&lfw);
#ifdef DEBUG
printf("CreateFontIndirectW %x\n", hFont);
#endif
return hFont;
}
MOZCE_SHUNT_API int mozce_EnumFontFamiliesA(HDC hdc, LPCTSTR lpszFamily, FONTENUMPROC lpEnumFontFamProc, LPARAM lParam)
{
#ifdef DEBUG
printf("-- mozce_EnumFontFamilies called\n");
#endif
return 0;
}
MOZCE_SHUNT_API int mozce_GetTextFaceA(HDC hdc, int nCount, LPCSTR lpFaceName)
MOZCE_SHUNT_API int mozce_GetTextFaceA(HDC hdc, int nCount, LPSTR lpFaceName)
{
printf("mozce_GetTextFace called\n");
#ifdef DEBUG
printf("mozce_GetTextFaceA called\n");
#endif
if (lpFaceName)
lpFaceName[0] = NULL;
int res;
LPWSTR lpFaceNameW = (LPWSTR) malloc((nCount + 1) * 2);
res = GetTextFaceW(hdc, nCount, lpFaceNameW);
if(!res && lpFaceName) {
WideCharToMultiByte(CP_ACP, 0, lpFaceNameW, -1, (char*) lpFaceName, nCount, NULL, NULL);
}
TCHAR* wBuffer = (TCHAR*) malloc(sizeof(TCHAR) * (nCount+1));
if (!wBuffer)
return GDI_ERROR;
res = GetTextFaceW(hdc, nCount, wBuffer);
if(res != GDI_ERROR && res != 0 && lpFaceName)
{
w2a_buffer(wBuffer, -1, lpFaceName, nCount);
}
free(wBuffer);
return res;
}
MOZCE_SHUNT_API BOOL mozce_GetTextMetricsA(HDC hdc, LPTEXTMETRICA lptma)
{
#ifdef DEBUG
printf("mozce_GetTextMetrics called\n");
#endif
TEXTMETRICW tmw;
BOOL res;

Просмотреть файл

@ -48,7 +48,9 @@ extern "C" {
MOZCE_SHUNT_API UINT mozce_GetWindowsDirectoryW(LPWSTR inBuffer, UINT inSize)
{
#ifdef DEBUG
printf("mozce_GetWindowsDirectoryW called\n");
#endif
UINT retval = 0;
@ -62,14 +64,15 @@ MOZCE_SHUNT_API UINT mozce_GetWindowsDirectoryW(LPWSTR inBuffer, UINT inSize)
retval = 8;
}
printf("GetWindowsDirectoryW\n");
return retval;
}
MOZCE_SHUNT_API UINT mozce_GetSystemDirectoryW(LPWSTR inBuffer, UINT inSize)
{
#ifdef DEBUG
printf("mozce_GetSystemDirectoryW called\n");
#endif
UINT retval = 0;
@ -83,14 +86,15 @@ MOZCE_SHUNT_API UINT mozce_GetSystemDirectoryW(LPWSTR inBuffer, UINT inSize)
retval = 8;
}
printf("GetSystemDirectoryW\n");
return retval;
}
MOZCE_SHUNT_API HANDLE mozce_OpenSemaphoreW(DWORD inDesiredAccess, BOOL inInheritHandle, LPCWSTR inName)
{
#ifdef DEBUG
printf("mozce_OpenSemaphoreW called\n");
#endif
HANDLE retval = NULL;
HANDLE semaphore = NULL;
@ -110,27 +114,29 @@ MOZCE_SHUNT_API HANDLE mozce_OpenSemaphoreW(DWORD inDesiredAccess, BOOL inInheri
}
}
printf("OpenSemaphoreW\n");
return retval;
}
MOZCE_SHUNT_API DWORD mozce_GetGlyphOutlineW(HDC inDC, WCHAR inChar, UINT inFormat, void* inGM, DWORD inBufferSize, LPVOID outBuffer, CONST mozce_MAT2* inMAT2)
{
#ifdef DEBUG
printf("mozce_GetGlyphOutlineW called\n");
#endif
DWORD retval = GDI_ERROR;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
printf("GetGlyphOutlineW\n");
return retval;
}
MOZCE_SHUNT_API DWORD mozce_GetCurrentDirectoryW(DWORD inBufferLength, LPTSTR outBuffer)
{
#ifdef DEBUG
printf("mozce_GetCurrentDirectoryW called\n");
#endif
DWORD retval = 0;
@ -141,20 +147,20 @@ MOZCE_SHUNT_API DWORD mozce_GetCurrentDirectoryW(DWORD inBufferLength, LPTSTR ou
SetLastError(ERROR_NOT_SUPPORTED);
printf("GetCurrentDirectoryW\n");
return retval;
}
MOZCE_SHUNT_API BOOL mozce_SetCurrentDirectoryW(LPCTSTR inPathName)
{
#ifdef DEBUG
printf("mozce_SetCurrentDirectoryW called\n");
#endif
BOOL retval = FALSE;
SetLastError(ERROR_NOT_SUPPORTED);
printf("SetCurrentDirectoryW\n");
return retval;
}