This commit is contained in:
dougt%meer.net 2005-07-06 05:15:55 +00:00
Родитель bbafa7161e
Коммит 01ccefa09b
2 изменённых файлов: 55 добавлений и 35 удалений

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

@ -731,6 +731,11 @@
#endif
#define CreateFontIndirectA mozce_CreateFontIndirectA
#ifdef CreateMutexA
#undef CreateMutexA
#endif
#define CreateMutexA mozce_CreateMutexA
#ifdef CreateProcessA
#undef CreateProcessA
#endif
@ -1354,6 +1359,7 @@ extern "C" {
MOZCE_SHUNT_API BOOL mozce_CopyFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, BOOL bFailIfExists);
MOZCE_SHUNT_API BOOL mozce_CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
MOZCE_SHUNT_API BOOL mozce_RemoveDirectoryA(LPCSTR lpPathName);
MOZCE_SHUNT_API HANDLE CreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCSTR lpName);
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);
MOZCE_SHUNT_API BOOL mozce_ExtTextOutA(HDC inDC, int inX, int inY, UINT inOptions, LPCRECT inRect, LPCSTR inString, UINT inCount, const LPINT inDx);
MOZCE_SHUNT_API BOOL mozce_TextOutA(HDC hdc, int nXStart, int nYStart, LPCSTR lpString, int cbString);

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

@ -212,6 +212,23 @@ MOZCE_SHUNT_API DWORD mozce_GetFileAttributesA(LPCSTR lpFileName)
return retval;
}
MOZCE_SHUNT_API HANDLE mozce_CreateMutexA(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCSTR lpName)
{
MOZCE_PRECHECK
#ifdef DEBUG
mozce_printf("mozce_CreateMutexA called\n");
#endif
if (!lpName)
return CreateMutexW(lpMutexAttributes, bInitialOwner, NULL);
LPTSTR widestr = a2w_malloc(lpName, -1, NULL);
HANDLE h = CreateMutexW(lpMutexAttributes, bInitialOwner, widestr);
free(widestr);
return h;
}
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)
{
MOZCE_PRECHECK
@ -534,43 +551,40 @@ MOZCE_SHUNT_API HDC mozce_CreateDCA(LPCSTR inDriver, LPCSTR inDevice, LPCSTR inO
LPTSTR wDriver = a2w_malloc(inDriver, -1, NULL);
LPTSTR wDevice = a2w_malloc(inDevice, -1, NULL);
LPTSTR wOutput = a2w_malloc(inOutput, -1, NULL);
DEVMODE wInitData;
if (inInitData)
{
memset(&wInitData, 0, sizeof(wInitData));
wInitData.dmSpecVersion = inInitData->dmSpecVersion;
wInitData.dmDriverVersion = inInitData->dmDriverVersion;
wInitData.dmSize = inInitData->dmSize;
wInitData.dmDriverExtra = inInitData->dmDriverExtra;
wInitData.dmFields = inInitData->dmFields;
wInitData.dmOrientation = inInitData->dmOrientation;
wInitData.dmPaperSize = inInitData->dmPaperSize;
wInitData.dmPaperLength = inInitData->dmPaperLength;
wInitData.dmPaperWidth = inInitData->dmPaperWidth;
wInitData.dmScale = inInitData->dmScale;
wInitData.dmCopies = inInitData->dmCopies;
wInitData.dmDefaultSource = inInitData->dmDefaultSource;
wInitData.dmPrintQuality = inInitData->dmPrintQuality;
wInitData.dmColor = inInitData->dmColor;
wInitData.dmDuplex = inInitData->dmDuplex;
wInitData.dmYResolution = inInitData->dmYResolution;
wInitData.dmTTOption = inInitData->dmTTOption;
wInitData.dmCollate = inInitData->dmCollate;
wInitData.dmLogPixels = inInitData->dmLogPixels;
wInitData.dmBitsPerPel = inInitData->dmBitsPerPel;
wInitData.dmPelsWidth = inInitData->dmPelsWidth;
wInitData.dmPelsHeight = inInitData->dmPelsHeight;
wInitData.dmDisplayFlags = inInitData->dmDisplayFlags;
wInitData.dmDisplayFrequency = inInitData->dmDisplayFrequency;
a2w_buffer((LPCSTR)inInitData->dmDeviceName, -1, wInitData.dmDeviceName, charcount(wInitData.dmDeviceName));
a2w_buffer((LPCSTR)inInitData->dmFormName, -1, wInitData.dmFormName, charcount(wInitData.dmFormName));
}
DEVMODE wInitData;
if (inInitData)
{
memset(&wInitData, 0, sizeof(wInitData));
wInitData.dmSpecVersion = inInitData->dmSpecVersion;
wInitData.dmDriverVersion = inInitData->dmDriverVersion;
wInitData.dmSize = inInitData->dmSize;
wInitData.dmDriverExtra = inInitData->dmDriverExtra;
wInitData.dmFields = inInitData->dmFields;
wInitData.dmOrientation = inInitData->dmOrientation;
wInitData.dmPaperSize = inInitData->dmPaperSize;
wInitData.dmPaperLength = inInitData->dmPaperLength;
wInitData.dmPaperWidth = inInitData->dmPaperWidth;
wInitData.dmScale = inInitData->dmScale;
wInitData.dmCopies = inInitData->dmCopies;
wInitData.dmDefaultSource = inInitData->dmDefaultSource;
wInitData.dmPrintQuality = inInitData->dmPrintQuality;
wInitData.dmColor = inInitData->dmColor;
wInitData.dmDuplex = inInitData->dmDuplex;
wInitData.dmYResolution = inInitData->dmYResolution;
wInitData.dmTTOption = inInitData->dmTTOption;
wInitData.dmCollate = inInitData->dmCollate;
wInitData.dmLogPixels = inInitData->dmLogPixels;
wInitData.dmBitsPerPel = inInitData->dmBitsPerPel;
wInitData.dmPelsWidth = inInitData->dmPelsWidth;
wInitData.dmPelsHeight = inInitData->dmPelsHeight;
wInitData.dmDisplayFlags = inInitData->dmDisplayFlags;
wInitData.dmDisplayFrequency = inInitData->dmDisplayFrequency;
a2w_buffer((LPCSTR)inInitData->dmDeviceName, -1, wInitData.dmDeviceName, charcount(wInitData.dmDeviceName));
a2w_buffer((LPCSTR)inInitData->dmFormName, -1, wInitData.dmFormName, charcount(wInitData.dmFormName));
}
retval = CreateDC(wDriver, wDevice, wOutput, inInitData ? &wInitData : NULL);
if(NULL != wDriver)
{
free(wDriver);