diff options
Diffstat (limited to 'loader')
41 files changed, 601 insertions, 601 deletions
diff --git a/loader/afl.c b/loader/afl.c index 36b666bb0a..e9f52e157e 100644 --- a/loader/afl.c +++ b/loader/afl.c @@ -5,7 +5,7 @@ Its content will be based mainly on wine/dlls/msacm32 actually, for audio decompression only the following functions are needed: - + acmStreamOpen ( takes formats of src and dest, returns stream handle ) acmStreamPrepareHeader ( takes stream handler and info on data ) acmStreamConvert ( the same as PrepareHeader ) @@ -13,13 +13,13 @@ acmStreamClose acmStreamSize maybe acmStreamReset - - In future I'll also add functions for format enumeration, + + In future I'll also add functions for format enumeration, but not right now. Modified for use with MPlayer, detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ - + ***************************************************************************/ #include "config.h" #include "debug.h" @@ -59,26 +59,26 @@ MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule, { if (!phadid) return MMSYSERR_INVALPARAM; - + /* Check if any unknown flags */ - if (fdwAdd & + if (fdwAdd & ~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND| ACM_DRIVERADDF_GLOBAL)) return MMSYSERR_INVALFLAG; - + /* Check if any incompatible flags */ - if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && + if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND)) return MMSYSERR_INVALFLAG; - - /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a + + /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a * LoadDriver on it, to be sure we can call SendDriverMessage on the * hDrvr handle. */ *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, 0, hinstModule); - + /* FIXME: lParam, dwPriority and fdwAdd ignored */ - + return MMSYSERR_NOERROR; } @@ -89,10 +89,10 @@ MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose) { PWINE_ACMDRIVER p; PWINE_ACMDRIVER* tp; - + if (fdwClose) return MMSYSERR_INVALFLAG; - + p = MSACM_GetDriver(had); if (!p) return MMSYSERR_INVALHANDLE; @@ -103,12 +103,12 @@ MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose) break; } } - + if (p->hDrvr && !p->obj.pACMDriverID->pACMDriverList) CloseDriver(p->hDrvr); - + HeapFree(MSACM_hHeap, 0, p); - + return MMSYSERR_NOERROR; } @@ -123,11 +123,11 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR if (!fnCallback) { return MMSYSERR_INVALPARAM; } - + if (fdwEnum && ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) { return MMSYSERR_INVALFLAG; } - + for (p = MSACM_pFirstACMDriverID; p; p = p->pNextACMDriverID) { fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; if (!p->bEnabled) { @@ -138,7 +138,7 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR } (*fnCallback)((HACMDRIVERID) p, dwInstance, fdwSupport); } - + return MMSYSERR_NOERROR; } @@ -148,19 +148,19 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID) { PWINE_ACMOBJ pao; - + pao = MSACM_GetObj(hao); if (!pao) return MMSYSERR_INVALHANDLE; - + if (!phadid) return MMSYSERR_INVALPARAM; - + if (fdwDriverID) return MMSYSERR_INVALFLAG; - + *phadid = (HACMDRIVERID) pao->pACMDriverID; - + return MMSYSERR_NOERROR; } @@ -174,12 +174,12 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA PWINE_ACMDRIVER pad = MSACM_GetDriver(had); if (!pad) return MMSYSERR_INVALPARAM; - + /* FIXME: Check if uMsg legal */ - + if (!SendDriverMessage(pad->hDrvr, uMsg, lParam1, lParam2)) return MMSYSERR_NOTSUPPORTED; - + return MMSYSERR_NOERROR; } @@ -198,14 +198,14 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe if (!phad) return MMSYSERR_INVALPARAM; - - padid = MSACM_GetDriverID(hadid); + + padid = MSACM_GetDriverID(hadid); if (!padid) return MMSYSERR_INVALHANDLE; - + if (fdwOpen) return MMSYSERR_INVALFLAG; - + pad = (PWINE_ACMDRIVER) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER)); if (!pad) return MMSYSERR_NOMEM; @@ -221,7 +221,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe pad->hDrvr = OpenDriverA((long)&icopen); else pad->hDrvr = padid->hInstModule; - + if (!pad->hDrvr) { HeapFree(MSACM_hHeap, 0, pad); return MMSYSERR_ERROR; @@ -245,16 +245,16 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove) { PWINE_ACMDRIVERID padid; - + padid = MSACM_GetDriverID(hadid); if (!padid) return MMSYSERR_INVALHANDLE; - + if (fdwRemove) return MMSYSERR_INVALFLAG; - + MSACM_UnregisterDriver(padid); - + return MMSYSERR_NOERROR; } @@ -267,7 +267,7 @@ PWINE_ACMDRIVERID MSACM_pFirstACMDriverID = NULL; PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL; /*********************************************************************** - * MSACM_RegisterDriver32() + * MSACM_RegisterDriver32() */ PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName, WORD wFormatTag, @@ -295,7 +295,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName, MSACM_pLastACMDriverID = padid; if (!MSACM_pFirstACMDriverID) MSACM_pFirstACMDriverID = padid; - + return padid; } @@ -306,13 +306,13 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName, PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p) { PWINE_ACMDRIVERID pNextACMDriverID; - + while (p->pACMDriverList) acmDriverClose((HACMDRIVER) p->pACMDriverList, 0); - + if (p->pszFileName) free(p->pszFileName); - + if (p == MSACM_pFirstACMDriverID) MSACM_pFirstACMDriverID = p->pNextACMDriverID; if (p == MSACM_pLastACMDriverID) @@ -322,11 +322,11 @@ PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p) p->pPrevACMDriverID->pNextACMDriverID = p->pNextACMDriverID; if (p->pNextACMDriverID) p->pNextACMDriverID->pPrevACMDriverID = p->pPrevACMDriverID; - + pNextACMDriverID = p->pNextACMDriverID; - + HeapFree(MSACM_hHeap, 0, p); - + return pNextACMDriverID; } @@ -343,7 +343,7 @@ void MSACM_UnregisterAllDrivers(void) } /*********************************************************************** - * MSACM_GetDriverID32() + * MSACM_GetDriverID32() */ PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID) { @@ -380,16 +380,16 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw MMRESULT ret; int wfxSrcSize; int wfxDstSize; - + TRACE("(%p, 0x%08x, %p, %p, %p, %ld, %ld, %ld)\n", phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen); - TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", - pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec, + TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", + pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec, pwfxSrc->nBlockAlign, pwfxSrc->wBitsPerSample, pwfxSrc->cbSize); - TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", - pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec, + TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", + pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec, pwfxDst->nBlockAlign, pwfxDst->wBitsPerSample, pwfxDst->cbSize); #define SIZEOF_WFX(wfx) (sizeof(WAVEFORMATEX) + ((wfx->wFormatTag == WAVE_FORMAT_PCM) ? 0 : wfx->cbSize)) @@ -414,19 +414,19 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw } else { was->drvInst.pwfltr = NULL; } - was->drvInst.dwCallback = dwCallback; + was->drvInst.dwCallback = dwCallback; was->drvInst.dwInstance = dwInstance; was->drvInst.fdwOpen = fdwOpen; - was->drvInst.fdwDriver = 0L; - was->drvInst.dwDriver = 0L; + was->drvInst.fdwDriver = 0L; + was->drvInst.dwDriver = 0L; was->drvInst.has = (HACMSTREAM)was; - + if (had) { if (!(wad = MSACM_GetDriver(had))) { ret = MMSYSERR_INVALPARAM; goto errCleanUp; } - + was->obj.pACMDriverID = wad->obj.pACMDriverID; was->pDrv = wad; was->hAcmDriver = 0; /* not to close it in acmStreamClose */ @@ -446,13 +446,13 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw else goto errCleanUp; - ret=acmDriverOpen2(drv_tag); + ret=acmDriverOpen2(drv_tag); if (ret == MMSYSERR_NOERROR) { if ((wad = MSACM_GetDriver(had)) != 0) { was->obj.pACMDriverID = wad->obj.pACMDriverID; was->pDrv = wad; was->hAcmDriver = had; - + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); if (ret == MMSYSERR_NOERROR) { if (fdwOpen & ACM_STREAMOPENF_QUERY) { @@ -464,7 +464,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw acmDriverClose(had, 0L);*/ //if(MSACM_pFirstACMDriverID==NULL) // MSACM_RegisterAllDrivers(); - + for (wadi = MSACM_pFirstACMDriverID; wadi; wadi = wadi->pNextACMDriverID) { /* Check Format */ @@ -476,7 +476,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw was->obj.pACMDriverID = wad->obj.pACMDriverID; was->pDrv = wad; was->hAcmDriver = had; - + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); //lhacm - crash printf("RETOPEN %d\n", ret); //ret = 0; @@ -487,7 +487,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw break; } } - // no match, close this acm driver and try next one + // no match, close this acm driver and try next one acmDriverClose(had, 0L); } } @@ -506,7 +506,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw #endif return ret; } -errCleanUp: +errCleanUp: if (phas) *phas = (HACMSTREAM)0; HeapFree(MSACM_hHeap, 0, was); @@ -519,16 +519,16 @@ MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose) { PWINE_ACMSTREAM was; MMRESULT ret; - + TRACE("(0x%08x, %ld)\n", has, fdwClose); - + if ((was = ACM_GetStream(has)) == NULL) { return MMSYSERR_INVALHANDLE; } ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (DWORD)&was->drvInst, 0); if (ret == MMSYSERR_NOERROR) { if (was->hAcmDriver) - acmDriverClose(was->hAcmDriver, 0L); + acmDriverClose(was->hAcmDriver, 0L); HeapFree(MSACM_hHeap, 0, was); #ifdef WIN32_LOADER CodecRelease(); @@ -541,7 +541,7 @@ MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose) /*********************************************************************** * acmStreamConvert (MSACM32.38) */ -MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwConvert) { PWINE_ACMSTREAM was; @@ -570,7 +570,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->pbPreparedDst != padsh->pbDst || padsh->cbPreparedDstLength < padsh->cbDstLength) { return MMSYSERR_INVALPARAM; - } + } padsh->fdwConvert = fdwConvert; @@ -586,7 +586,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, /*********************************************************************** * acmStreamPrepareHeader (MSACM32.41) */ -MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwPrepare) { PWINE_ACMSTREAM was; @@ -594,7 +594,7 @@ MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, PACMDRVSTREAMHEADER padsh; TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwPrepare); - + if ((was = ACM_GetStream(has)) == NULL) return MMSYSERR_INVALHANDLE; if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) @@ -669,15 +669,15 @@ MMRESULT WINAPI acmStreamReset(HACMSTREAM has, DWORD fdwReset) /*********************************************************************** * acmStreamSize (MSACM32.43) */ -MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, +MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize) { PWINE_ACMSTREAM was; ACMDRVSTREAMSIZE adss; MMRESULT ret; - + TRACE("(0x%08x, %ld, %p, %ld)\n", has, cbInput, pdwOutputBytes, fdwSize); - + if ((was = ACM_GetStream(has)) == NULL) { return MMSYSERR_INVALHANDLE; } @@ -686,7 +686,7 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, } *pdwOutputBytes = 0L; - + switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { case ACM_STREAMSIZEF_DESTINATION: adss.cbDstLength = cbInput; @@ -696,13 +696,13 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, adss.cbSrcLength = cbInput; adss.cbDstLength = 0; break; - default: + default: return MMSYSERR_INVALFLAG; } - + adss.cbStruct = sizeof(adss); adss.fdwSize = fdwSize; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, (DWORD)&was->drvInst, (DWORD)&adss); if (ret == MMSYSERR_NOERROR) { switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { @@ -721,7 +721,7 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, /*********************************************************************** * acmStreamUnprepareHeader (MSACM32.44) */ -MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwUnprepare) { PWINE_ACMSTREAM was; @@ -729,7 +729,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, PACMDRVSTREAMHEADER padsh; TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwUnprepare); - + if ((was = ACM_GetStream(has)) == NULL) return MMSYSERR_INVALHANDLE; if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) @@ -750,7 +750,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->pbPreparedDst != padsh->pbDst || padsh->cbPreparedDstLength < padsh->cbDstLength) { return MMSYSERR_INVALPARAM; - } + } padsh->fdwConvert = fdwUnprepare; diff --git a/loader/com.h b/loader/com.h index 27f6a916b7..6bbbc55b7d 100644 --- a/loader/com.h +++ b/loader/com.h @@ -71,7 +71,7 @@ struct IClassFactory struct IClassFactory_vt* vt; }; -#ifdef WIN32_LOADER +#ifdef WIN32_LOADER long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter, long dwClsContext, const GUID* riid, void** ppv); void* CoTaskMemAlloc(unsigned long cb); diff --git a/loader/dmo/DMO_AudioDecoder.c b/loader/dmo/DMO_AudioDecoder.c index 033133c6fc..1b08757349 100644 --- a/loader/dmo/DMO_AudioDecoder.c +++ b/loader/dmo/DMO_AudioDecoder.c @@ -14,7 +14,7 @@ #include "DMO_AudioDecoder.h" struct DMO_AudioDecoder -{ +{ DMO_MEDIA_TYPE m_sOurType, m_sDestType; DMO_Filter* m_pDMO_Filter; char* m_sVhdr; @@ -44,17 +44,17 @@ DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX Setup_LDT_Keeper(); Setup_FS_Segment(); #endif - + this = malloc(sizeof(DMO_AudioDecoder)); - + this->m_iFlushed=1; - + sz = 18 + wf->cbSize; this->m_sVhdr = malloc(sz); memcpy(this->m_sVhdr, wf, sz); this->m_sVhdr2 = malloc(18); memcpy(this->m_sVhdr2, this->m_sVhdr, 18); - + pWF = (WAVEFORMATEX*)this->m_sVhdr2; pWF->wFormatTag = 1; pWF->wBitsPerSample = 16; @@ -62,7 +62,7 @@ DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX pWF->nBlockAlign = 2*pWF->nChannels; //pWF->nChannels * (pWF->wBitsPerSample + 7) / 8; pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec; pWF->cbSize = 0; - + memset(&this->m_sOurType, 0, sizeof(this->m_sOurType)); this->m_sOurType.majortype=MEDIATYPE_Audio; this->m_sOurType.subtype=MEDIASUBTYPE_PCM; @@ -92,7 +92,7 @@ print_wave_header((WAVEFORMATEX *)this->m_sVhdr2, MSGL_V); free(this); return NULL; } - + return this; } @@ -120,7 +120,7 @@ int DMO_AudioDecoder_Convert(DMO_AudioDecoder *this, const void* in_data, unsign #ifdef WIN32_LOADER Setup_FS_Segment(); #endif - + //m_pDMO_Filter->m_pMedia->vt->Lock(m_pDMO_Filter->m_pMedia, 1); bufferin = CMediaBufferCreate(in_size, (void*)in_data, in_size, 1); r = this->m_pDMO_Filter->m_pMedia->vt->ProcessInput(this->m_pDMO_Filter->m_pMedia, 0, @@ -148,7 +148,7 @@ int DMO_AudioDecoder_Convert(DMO_AudioDecoder *this, const void* in_data, unsign ((IMediaBuffer*)db.pBuffer)->vt->GetBufferAndLength((IMediaBuffer*)db.pBuffer, 0, &written); ((IMediaBuffer*)db.pBuffer)->vt->Release((IUnknown*)db.pBuffer); - + //printf("RESULTB: %d 0x%x %ld\n", r, r, written); //printf("Converted %d -> %d\n", in_size, out_size); } diff --git a/loader/dmo/DMO_VideoDecoder.c b/loader/dmo/DMO_VideoDecoder.c index 9f3e9d7eb8..334acacedf 100644 --- a/loader/dmo/DMO_VideoDecoder.c +++ b/loader/dmo/DMO_VideoDecoder.c @@ -20,7 +20,7 @@ struct DMO_VideoDecoder { IVideoDecoder iv; - + DMO_Filter* m_pDMO_Filter; AM_MEDIA_TYPE m_sOurType, m_sDestType; VIDEOINFOHEADER* m_sVhdr; @@ -63,7 +63,7 @@ struct ct { int cap; char *name; }; - + static ct check[] = { { fccI420, 12, &MEDIASUBTYPE_I420, CAP_I420, NULL }, { fccYV12, 12, &MEDIASUBTYPE_YV12, CAP_YV12, NULL }, @@ -86,10 +86,10 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE DMO_VideoDecoder *this; HRESULT result; ct* c; - + this = malloc(sizeof(DMO_VideoDecoder)); memset( this, 0, sizeof(DMO_VideoDecoder)); - + this->m_sVhdr2 = 0; this->m_iLastQuality = -1; this->m_iMaxAuto = maxauto; @@ -103,10 +103,10 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE /*try*/ { unsigned int bihs; - + bihs = (format->biSize < (int) sizeof(BITMAPINFOHEADER)) ? sizeof(BITMAPINFOHEADER) : format->biSize; - + this->iv.m_bh = malloc(bihs); memcpy(this->iv.m_bh, format, bihs); this->iv.m_bh->biSize = bihs; @@ -118,7 +118,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->iv.m_iPlaypos = -1; this->iv.m_fQuality = 0.0f; this->iv.m_bCapable16b = true; - + bihs += sizeof(VIDEOINFOHEADER) - sizeof(BITMAPINFOHEADER); this->m_sVhdr = malloc(bihs); memset(this->m_sVhdr, 0, bihs); @@ -162,7 +162,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->m_sDestType.pUnk = 0; this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); this->m_sDestType.pbFormat = (char*)this->m_sVhdr2; - + memset(&this->iv.m_obh, 0, sizeof(this->iv.m_obh)); memcpy(&this->iv.m_obh, this->iv.m_bh, sizeof(this->iv.m_obh) < (unsigned) this->iv.m_bh->biSize ? sizeof(this->iv.m_obh) : (unsigned) this->iv.m_bh->biSize); @@ -175,7 +175,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->m_pDMO_Filter = DMO_FilterCreate(dllname, guid, &this->m_sOurType, &this->m_sDestType); - + if (!this->m_pDMO_Filter) { printf("Failed to create DMO filter\n"); @@ -217,7 +217,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE break; #endif default: - + this->m_Caps = CAP_NONE; printf("Decoder supports the following formats: "); @@ -275,7 +275,7 @@ void DMO_VideoDecoder_StartInternal(DMO_VideoDecoder *this) Debug printf("DMO_VideoDecoder_StartInternal\n"); //cout << "DSSTART" << endl; this->m_pDMO_Filter->Start(this->m_pDMO_Filter); - + props.cBuffers = 1; props.cbBuffer = this->m_sDestType.lSampleSize; @@ -283,7 +283,7 @@ void DMO_VideoDecoder_StartInternal(DMO_VideoDecoder *this) props.cbPrefix = 0; this->m_pDMO_Filter->m_pAll->vt->SetProperties(this->m_pDMO_Filter->m_pAll, &props, &props1); this->m_pDMO_Filter->m_pAll->vt->Commit(this->m_pDMO_Filter->m_pAll); -#endif +#endif this->iv.m_State = START; } @@ -301,7 +301,7 @@ int DMO_VideoDecoder_DecodeInternal(DMO_VideoDecoder *this, const void* src, int DMO_OUTPUT_DATA_BUFFER db; CMediaBuffer* bufferin; //+ uint8_t* imdata = dest ? dest->Data() : 0; - + Debug printf("DMO_VideoDecoder_DecodeInternal(%p,%p,%d,%d,%p)\n",this,src,size,is_keyframe,imdata); // this->m_pDMO_Filter->m_pAll->vt->GetBuffer(this->m_pDMO_Filter->m_pAll, &sample, 0, 0, 0); @@ -362,14 +362,14 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c { HRESULT result; int should_test=1; - + Debug printf("DMO_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp); - + /* if (!CImage::Supported(csp, bits)) return -1; */ // BitmapInfo temp = m_obh; - + if (!csp) // RGB { int ok = true; @@ -400,7 +400,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c this->iv.m_obh.biCompression=3;//BI_BITFIELDS this->iv.m_obh.biSizeImage=abs((int)(2*this->iv.m_obh.biWidth*this->iv.m_obh.biHeight)); } - + if( bits == 16 ) { this->iv.m_obh.colors[0]=0xF800; this->iv.m_obh.colors[1]=0x07E0; diff --git a/loader/dshow/DS_AudioDecoder.c b/loader/dshow/DS_AudioDecoder.c index 645c8b517b..b18b646160 100644 --- a/loader/dshow/DS_AudioDecoder.c +++ b/loader/dshow/DS_AudioDecoder.c @@ -11,7 +11,7 @@ #include "DS_Filter.h" struct DS_AudioDecoder -{ +{ WAVEFORMATEX in_fmt; AM_MEDIA_TYPE m_sOurType, m_sDestType; DS_Filter* m_pDS_Filter; @@ -44,22 +44,22 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* Setup_LDT_Keeper(); Setup_FS_Segment(); #endif - + this = malloc(sizeof(DS_AudioDecoder)); - + sz = 18 + wf->cbSize; this->m_sVhdr = malloc(sz); memcpy(this->m_sVhdr, wf, sz); this->m_sVhdr2 = malloc(18); memcpy(this->m_sVhdr2, this->m_sVhdr, 18); - + pWF = (WAVEFORMATEX*)this->m_sVhdr2; pWF->wFormatTag = 1; pWF->wBitsPerSample = 16; pWF->nBlockAlign = pWF->nChannels * (pWF->wBitsPerSample + 7) / 8; pWF->cbSize = 0; pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec; - + memcpy(&this->in_fmt,wf,sizeof(WAVEFORMATEX)); memset(&this->m_sOurType, 0, sizeof(this->m_sOurType)); @@ -100,7 +100,7 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* free(this); return NULL; } - + //Commit should be done before binary codec start this->m_pDS_Filter->m_pAll->vt->Commit(this->m_pDS_Filter->m_pAll); @@ -134,7 +134,7 @@ int DS_AudioDecoder_Convert(DS_AudioDecoder *this, const void* in_data, unsigned { unsigned int written = 0; unsigned int read = 0; - + if (!in_data || !out_data) return -1; @@ -185,7 +185,7 @@ int DS_AudioDecoder_GetSrcSize(DS_AudioDecoder *this, int dest_size) double efficiency =(double) this->in_fmt.nAvgBytesPerSec / (this->in_fmt.nSamplesPerSec*this->in_fmt.nBlockAlign); int frames = (int)(dest_size*efficiency); - + if (frames < 1) frames = 1; return frames * this->in_fmt.nBlockAlign; diff --git a/loader/dshow/DS_Filter.c b/loader/dshow/DS_Filter.c index 11dd11dee9..5fb1ec73dc 100644 --- a/loader/dshow/DS_Filter.c +++ b/loader/dshow/DS_Filter.c @@ -26,8 +26,8 @@ const GUID IID_IClassFactory = {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} }; -HRESULT STDCALL CoInitialize(LPVOID pvReserved); -void STDCALL CoUninitialize(void); +HRESULT STDCALL CoInitialize(LPVOID pvReserved); +void STDCALL CoUninitialize(void); #endif static void DS_Filter_Start(DS_Filter* This) @@ -137,9 +137,9 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id, #endif /* - tempAll is not used anywhere. + tempAll is not used anywhere. MemAllocatorCreate() is called to ensure that RegisterComObject for IMemoryAllocator - will be called before possible call + will be called before possible call to CoCreateInstance(...,&IID_IMemoryAllocator,...) from binary codec. */ tempAll=MemAllocatorCreate(); diff --git a/loader/dshow/DS_VideoDecoder.c b/loader/dshow/DS_VideoDecoder.c index a10436e325..7f5c8994ad 100644 --- a/loader/dshow/DS_VideoDecoder.c +++ b/loader/dshow/DS_VideoDecoder.c @@ -14,7 +14,7 @@ struct DS_VideoDecoder { IVideoDecoder iv; - + DS_Filter* m_pDS_Filter; AM_MEDIA_TYPE m_sOurType, m_sDestType; VIDEOINFOHEADER* m_sVhdr; @@ -53,7 +53,7 @@ static SampleProcUserData sampleProcData; int DS_VideoDecoder_GetCapabilities(DS_VideoDecoder *this) {return this->m_Caps;} - + typedef struct ct ct; struct ct { @@ -62,7 +62,7 @@ struct ct { const GUID *subtype; int cap; }; - + static ct check[] = { {16, fccYUY2, &MEDIASUBTYPE_YUY2, CAP_YUY2}, {12, fccIYUV, &MEDIASUBTYPE_IYUV, CAP_IYUV}, @@ -81,10 +81,10 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD DS_VideoDecoder *this; HRESULT result; ct* c; - + this = malloc(sizeof(DS_VideoDecoder)); memset( this, 0, sizeof(DS_VideoDecoder)); - + this->m_sVhdr2 = 0; this->m_iLastQuality = -1; this->m_iMaxAuto = maxauto; @@ -98,10 +98,10 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD /*try*/ { unsigned int bihs; - + bihs = (format->biSize < (int) sizeof(BITMAPINFOHEADER)) ? sizeof(BITMAPINFOHEADER) : format->biSize; - + this->iv.m_bh = malloc(bihs); memcpy(this->iv.m_bh, format, bihs); this->iv.m_bh->biSize = bihs; @@ -113,7 +113,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD this->iv.m_iPlaypos = -1; this->iv.m_fQuality = 0.0f; this->iv.m_bCapable16b = true; - + bihs += sizeof(VIDEOINFOHEADER) - sizeof(BITMAPINFOHEADER); this->m_sVhdr = malloc(bihs); memset(this->m_sVhdr, 0, bihs); @@ -153,7 +153,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD this->m_sDestType.pUnk = 0; this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); this->m_sDestType.pbFormat = (char*)this->m_sVhdr2; - + memset(&this->iv.m_obh, 0, sizeof(this->iv.m_obh)); memcpy(&this->iv.m_obh, this->iv.m_bh, sizeof(this->iv.m_obh) < (unsigned) this->iv.m_bh->biSize ? sizeof(this->iv.m_obh) : (unsigned) this->iv.m_bh->biSize); @@ -166,7 +166,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD this->m_pDS_Filter = DS_FilterCreate(dllname, guid, &this->m_sOurType, &this->m_sDestType,&sampleProcData); - + if (!this->m_pDS_Filter) { printf("Failed to create DirectShow filter\n"); @@ -207,7 +207,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD break; #endif default: - + this->m_Caps = CAP_NONE; printf("Decoder supports the following YUV formats: "); @@ -269,7 +269,7 @@ void DS_VideoDecoder_StartInternal(DS_VideoDecoder *this) //cout << "DSSTART" << endl; this->m_pDS_Filter->m_pAll->vt->Commit(this->m_pDS_Filter->m_pAll); this->m_pDS_Filter->Start(this->m_pDS_Filter); - + this->iv.m_State = START; } @@ -284,17 +284,17 @@ int DS_VideoDecoder_DecodeInternal(DS_VideoDecoder *this, const void* src, int s IMediaSample* sample = 0; char* ptr; int result; - + Debug printf("DS_VideoDecoder_DecodeInternal(%p,%p,%d,%d,%p)\n",this,src,size,is_keyframe,pImage); - + this->m_pDS_Filter->m_pAll->vt->GetBuffer(this->m_pDS_Filter->m_pAll, &sample, 0, 0, 0); - + if (!sample) { Debug printf("ERROR: null sample\n"); return -1; } - + //cout << "DECODE " << (void*) pImage << " d: " << (void*) pImage->Data() << endl; @@ -409,14 +409,14 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp ALLOCATOR_PROPERTIES props,props1; int should_test=1; int stopped = 0; - + Debug printf("DS_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp); - + /* if (!CImage::Supported(csp, bits)) return -1; */ // BitmapInfo temp = m_obh; - + if (!csp) // RGB { int ok = true; @@ -450,7 +450,7 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp this->iv.m_obh.biCompression=3;//BI_BITFIELDS this->iv.m_obh.biSizeImage=abs((int)(2*this->iv.m_obh.biWidth*this->iv.m_obh.biHeight)); } - + if( bits == 16 ) { this->iv.m_obh.colors[0]=0xF800; this->iv.m_obh.colors[1]=0x07E0; @@ -628,7 +628,7 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp if (stopped) { DS_VideoDecoder_StartInternal(this); - this->iv.m_State = START; + this->iv.m_State = START; } return 0; @@ -814,7 +814,7 @@ int DS_VideoDecoder_SetValue(DS_VideoDecoder *this, const char* name, int value) } return 0; } -#if 0 +#if 0 if (strcmp((const char*)record.dll, "ir50_32.dll") == 0) { IHidden2* hidden = 0; @@ -872,23 +872,23 @@ int DS_SetAttr_DivX(char* attribute, int value){ { printf("VideoDecoder::SetExtAttr: registry failure\n"); return -1; - } + } result=RegSetValueExA(newkey, "Current Post Process Mode", 0, REG_DWORD, &value, 4); if(result!=0) { printf("VideoDecoder::SetExtAttr: error writing value\n"); return -1; - } + } value=-1; result=RegSetValueExA(newkey, "Force Post Process Mode", 0, REG_DWORD, &value, 4); if(result!=0) { printf("VideoDecoder::SetExtAttr: error writing value\n"); return -1; - } + } RegCloseKey(newkey); return 0; - } + } if( (strcasecmp(attribute, "Saturation")==0) || @@ -903,16 +903,16 @@ int DS_SetAttr_DivX(char* attribute, int value){ { printf("VideoDecoder::SetExtAttr: registry failure\n"); return -1; - } + } result=RegSetValueExA(newkey, attribute, 0, REG_DWORD, &value, 4); if(result!=0) { printf("VideoDecoder::SetExtAttr: error writing value\n"); return -1; - } + } RegCloseKey(newkey); return 0; - } + } printf("Unknown attribute!\n"); return -200; diff --git a/loader/dshow/allocator.c b/loader/dshow/allocator.c index 4323e4a176..3e0deabceb 100644 --- a/loader/dshow/allocator.c +++ b/loader/dshow/allocator.c @@ -147,7 +147,7 @@ static HRESULT STDCALL MemAllocator_SetProperties(IMemAllocator * This, *pActual = *pRequest; /* DirectShow DOCS ("Negotiating Allocators" chapter) says that allocator might not - honor the requested properties. Thus, since WMSP audio codecs requests bufer with two + honor the requested properties. Thus, since WMSP audio codecs requests bufer with two bytes length for unknown reason, we should correct requested value. Otherwise above codec don't want to load. */ diff --git a/loader/dshow/cmediasample.c b/loader/dshow/cmediasample.c index 0c7c25d119..98a864b3be 100644 --- a/loader/dshow/cmediasample.c +++ b/loader/dshow/cmediasample.c @@ -119,7 +119,7 @@ static long STDCALL CMediaSample_Release(IUnknown* This) * \param[out] address of variable that receives pointer to sample's buffer * * \return S_OK success - * \return apropriate error otherwise + * \return apropriate error otherwise * * \note The calles should not free or reallocate buffer * @@ -157,7 +157,7 @@ static long STDCALL CMediaSample_GetSize(IMediaSample * This) * * \return S_OK success * \return VFW_E_NO_STOP_TIME The sample has valid start time, but no stop time - * \return VFW_E_SAMPLE_TIME_NOT_SET The sample is not time-stamped + * \return VFW_E_SAMPLE_TIME_NOT_SET The sample is not time-stamped * * \remarks * Both values are relative to stream time @@ -334,7 +334,7 @@ static HRESULT STDCALL CMediaSample_SetActualDataLength(IMediaSample* This, * * \remarks * If media type is not changed from previous sample, ppMediaType is null - * If method returns S_OK caller should free memory allocated for structure + * If method returns S_OK caller should free memory allocated for structure * including pbFormat block */ static HRESULT STDCALL CMediaSample_GetMediaType(IMediaSample* This, @@ -384,7 +384,7 @@ static HRESULT STDCALL CMediaSample_SetMediaType(IMediaSample * This, } /** - * \brief IMediaSample::IsDiscontinuity (determines if this sample represents data break + * \brief IMediaSample::IsDiscontinuity (determines if this sample represents data break * in stream) * * \param[in] This pointer to CMediaSample object @@ -392,7 +392,7 @@ static HRESULT STDCALL CMediaSample_SetMediaType(IMediaSample * This, * \return S_OK if this sample is break in data stream * \return S_FALSE otherwise * - * \remarks + * \remarks * Discontinuity occures when filter seeks to different place in the stream or when drops * samples. * @@ -404,7 +404,7 @@ static HRESULT STDCALL CMediaSample_IsDiscontinuity(IMediaSample * This) } /** - * \brief IMediaSample::IsDiscontinuity (specifies whether this sample represents data break + * \brief IMediaSample::IsDiscontinuity (specifies whether this sample represents data break * in stream) * * \param[in] This pointer to CMediaSample object @@ -430,7 +430,7 @@ static HRESULT STDCALL CMediaSample_SetDiscontinuity(IMediaSample * This, * \param[out] pTimeEnd pointer to variable that receives end time * * \return S_OK success - * \return VFW_E_MEDIA_TIME_NOT_SET The sample is not time-stamped + * \return VFW_E_MEDIA_TIME_NOT_SET The sample is not time-stamped * */ static HRESULT STDCALL CMediaSample_GetMediaTime(IMediaSample * This, diff --git a/loader/dshow/inputpin.c b/loader/dshow/inputpin.c index c5aa5eff47..37d9f758fa 100644 --- a/loader/dshow/inputpin.c +++ b/loader/dshow/inputpin.c @@ -445,9 +445,9 @@ static long STDCALL CInputPin_QueryInternalConnections(IPin* This, * \return S_OK - success * \return E_UNEXPECTED - The pin is output pin * - * \note - * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, - * IMemAllocator::GetBuffer runs in different (streaming) thread then other + * \note + * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, + * IMemAllocator::GetBuffer runs in different (streaming) thread then other * methods (application thread). * IMemoryInputPin::NewSegment runs either in streaming or application thread. * Developer must use critical sections for thread-safing work. @@ -602,7 +602,7 @@ static long STDCALL CBaseFilter_GetClassID(IBaseFilter * This, * * \remarks * When filter is stopped it does onot deliver or process any samples and rejects any samples - * from upstream filter. + * from upstream filter. * Transition may be asynchronous. In this case method should return S_FALSE. * Method always sets filter's state to State_Stopped even if error occured. * @@ -700,8 +700,8 @@ static long STDCALL CBaseFilter_SetSyncSource(IBaseFilter* This, * \brief IMediafilter::GetSyncSource (gets current reference clock) * * \param[in] This pointer to IBaseFilter interface - * \param[out] pClock address of variable that receives pointer to clock's - * IReferenceClock interface + * \param[out] pClock address of variable that receives pointer to clock's + * IReferenceClock interface * * \return S_OK success * \return E_POINTER Null pointer @@ -790,7 +790,7 @@ static long STDCALL CBaseFilter_QueryFilterInfo(IBaseFilter* This, * * \remarks * Filter should not call to graph's AddRef method. - * The IFilterGraph is guaranteed to be valid until graph manager calls this method again with + * The IFilterGraph is guaranteed to be valid until graph manager calls this method again with * the value NULL. * */ @@ -943,7 +943,7 @@ static long STDCALL CBaseFilter2_GetClassID(IBaseFilter* This, * * \remarks * When filter is stopped it does onot deliver or process any samples and rejects any samples - * from upstream filter. + * from upstream filter. * Transition may be asynchronous. In this case method should return S_FALSE. * Method always sets filter's state to State_Stopped even if error occured. * @@ -1042,8 +1042,8 @@ static long STDCALL CBaseFilter2_SetSyncSource(IBaseFilter* This, * \brief IMediafilter::GetSyncSource (gets current reference clock) * * \param[in] This pointer to IBaseFilter interface - * \param[out] pClock address of variable that receives pointer to clock's - * IReferenceClock interface + * \param[out] pClock address of variable that receives pointer to clock's + * IReferenceClock interface * * \return S_OK success * \return E_POINTER Null pointer @@ -1131,7 +1131,7 @@ static long STDCALL CBaseFilter2_QueryFilterInfo(IBaseFilter* This, * * \remarks * Filter should not call to graph's AddRef method. - * The IFilterGraph is guaranteed to be valid until graph manager calls this method again with + * The IFilterGraph is guaranteed to be valid until graph manager calls this method again with * the value NULL. * */ diff --git a/loader/dshow/libwin32.h b/loader/dshow/libwin32.h index 509941432b..70d5e0f006 100644 --- a/loader/dshow/libwin32.h +++ b/loader/dshow/libwin32.h @@ -31,7 +31,7 @@ typedef struct CodecInfo typedef struct CImage // public your_libvo_mem { char* ptr; - + /*char* (*Data)(); { return 0; @@ -40,7 +40,7 @@ typedef struct CImage // public your_libvo_mem /*int (*Supported)(fourcc_t csp, int bits); { return true; - // if you support such surface + // if you support such surface }*/ }CImage; @@ -109,7 +109,7 @@ typedef struct BitmapInfo long biYPelsPerMeter; long biClrUsed; long biClrImportant; - int colors[3]; + int colors[3]; } BitmapInfo; typedef struct IVideoDecoder diff --git a/loader/dshow/mediatype.c b/loader/dshow/mediatype.c index fc37f972f3..d6597fa767 100644 --- a/loader/dshow/mediatype.c +++ b/loader/dshow/mediatype.c @@ -32,8 +32,8 @@ void DisplayMediaType(const char * label,const AM_MEDIA_TYPE* pmt){ VIDEOINFOHEADER* Vhdr; int i; GUID* iid; - - + + Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"=======================\n"); if(label){ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"AM_MEDIA_TYPE: %s\n",label); @@ -103,7 +103,7 @@ HRESULT CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc) if(pSrc == pDest) return E_INVALIDARG; if(!pSrc->pbFormat && pSrc->cbFormat) return E_POINTER; - + memcpy(pDest, pSrc, sizeof(AM_MEDIA_TYPE)); if (!pSrc->pbFormat) return S_OK; if (!(pDest->pbFormat = CoTaskMemAlloc(pSrc->cbFormat))) diff --git a/loader/dshow/mediatype.h b/loader/dshow/mediatype.h index c58bb32e9f..ecb696ca39 100644 --- a/loader/dshow/mediatype.h +++ b/loader/dshow/mediatype.h @@ -8,7 +8,7 @@ #define MPLAYER_MEDIATYPE_H #include "guids.h" - + typedef struct __attribute__((__packed__)) MediaType { GUID majortype; //0x0 @@ -26,7 +26,7 @@ typedef struct __attribute__((__packed__)) MediaType * \brief print info from AM_MEDIA_TYPE structure * =param[in] label short lable for media type * \param[in] pmt pointer to AM_MEDIA_TYPE - * + * * routine used for debug purposes * */ @@ -61,7 +61,7 @@ void DeleteMediaType(AM_MEDIA_TYPE* pmt); * * \return S_OK - success * \return E_POINTER - pSrc or pDst is NULL or (pSrc->cbFormat && !pSrc->pbFormat) - * \return E_INVALIDARG - (pSrc == pDst) + * \return E_INVALIDARG - (pSrc == pDst) * \return E_OUTOFMEMORY - Insufficient memory * * \note diff --git a/loader/dshow/outputpin.c b/loader/dshow/outputpin.c index 534ff13615..d876f4401f 100644 --- a/loader/dshow/outputpin.c +++ b/loader/dshow/outputpin.c @@ -493,9 +493,9 @@ static HRESULT STDCALL COutputPin_QueryInternalConnections(IPin * This, * \return S_OK - success * \return E_UNEXPECTED - The pin is output pin * - * \note - * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, - * IMemAllocator::GetBuffer runs in different (streaming) thread then other + * \note + * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, + * IMemAllocator::GetBuffer runs in different (streaming) thread then other * methods (application thread). * IMemoryInputPin::NewSegment runs either in streaming or application thread. * Developer must use critical sections for thread-safing work. @@ -697,9 +697,9 @@ static HRESULT STDCALL COutputMemPin_GetAllocatorRequirements(IMemInputPin* This * In the last case method might block indefinitely. If this might * happen IMemInpuPin::ReceiveCAnBlock returns S_OK * - * \note - * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, - * IMemAllocator::GetBuffer runs in different (streaming) thread then other + * \note + * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, + * IMemAllocator::GetBuffer runs in different (streaming) thread then other * methods (application thread). * IMemoryInputPin::NewSegment runs either in streaming or application thread. * Developer must use critical sections for thread-safing work. @@ -736,9 +736,9 @@ static HRESULT STDCALL COutputMemPin_Receive(IMemInputPin* This, * \remarks * This method behaves like IMemInputPin::Receive but for array of samples * - * \note - * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, - * IMemAllocator::GetBuffer runs in different (streaming) thread then other + * \note + * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, + * IMemAllocator::GetBuffer runs in different (streaming) thread then other * methods (application thread). * IMemoryInputPin::NewSegment runs either in streaming or application thread. * Developer must use critical sections for thread-safing work. diff --git a/loader/elfdll.c b/loader/elfdll.c index fe71cbd911..1927640505 100644 --- a/loader/elfdll.c +++ b/loader/elfdll.c @@ -213,7 +213,7 @@ static WINE_MODREF *ELFDLL_CreateModref(HMODULE hModule, LPCSTR path) /* Link MODREF into process list */ // EnterCriticalSection( &PROCESS_Current()->crit_section ); - + if(local_wm) { local_wm->next = (modref_list*) malloc(sizeof(modref_list)); @@ -227,7 +227,7 @@ static WINE_MODREF *ELFDLL_CreateModref(HMODULE hModule, LPCSTR path) local_wm = (modref_list*) malloc(sizeof(modref_list)); local_wm->next=local_wm->prev=NULL; local_wm->wm=wm; - } + } // LeaveCriticalSection( &PROCESS_Current()->crit_section ); return wm; @@ -263,7 +263,7 @@ WINE_MODREF *ELFDLL_LoadLibraryExA(LPCSTR path, DWORD flags) /* strcpy(soname, name); strcat(soname, "_elfdll_image"); image = (struct elfdll_image *)dlsym(dlhandle, soname); - if(!image) + if(!image) { ERR("Could not get elfdll image descriptor %s (%s)\n", soname, dlerror()); dlclose(dlhandle); diff --git a/loader/ext.c b/loader/ext.c index b57eed674b..23c0292c6c 100644 --- a/loader/ext.c +++ b/loader/ext.c @@ -250,7 +250,7 @@ LPVOID FILE_dommap( int unix_handle, LPVOID start, { ret = mmap_anon( start, size_low, prot, flags, offset_low ); } - else + else { fd = unix_handle; ret = mmap( start, size_low, prot, flags, fd, offset_low ); diff --git a/loader/ldt_keeper.c b/loader/ldt_keeper.c index e0d4447e60..8bffa6e958 100644 --- a/loader/ldt_keeper.c +++ b/loader/ldt_keeper.c @@ -211,7 +211,7 @@ ldt_fs_t* Setup_LDT_Keeper(void) if (getenv("DYLD_BIND_AT_LAUNCH") == NULL) mp_msg(MSGT_LOADER, MSGL_WARN, MSGTR_LOADER_DYLD_Warning); #endif /* __APPLE__ */ - + fs_seg= ldt_fs->fs_seg = mmap_anon(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, 0); if (ldt_fs->fs_seg == (void*)-1) diff --git a/loader/module.c b/loader/module.c index 4945125521..2bce928544 100644 --- a/loader/module.c +++ b/loader/module.c @@ -649,7 +649,7 @@ FARPROC WINAPI GetProcAddress( HMODULE hModule, LPCSTR function ) #ifdef DEBUG_QTX_API -/* +/* http://lists.apple.com/archives/quicktime-api/2003/Jan/msg00278.html */ @@ -720,7 +720,7 @@ static int dump_component(char* name, int type, void* orig, ComponentParameters ++c_level; ret=orig(params,glob); --c_level; - + if(ret>=0x1000) fprintf(stderr,"%*s return=0x%X\n",3*c_level,"",ret); else @@ -757,35 +757,35 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t char* pname=NULL; int plen=-1; // find the code: - + dptr=0x62b67ae0;dptr+=2*((reg->eax>>16)&255); // printf("FUNC: flag=%d ptr=%p\n",dptr[0],dptr[1]); if(dptr[0]&255){ dptr=dptr[1];dptr+=4*(reg->eax&65535); // printf("FUNC: ptr2=%p eax=%p edx=%p\n",dptr[1],dptr[0],dptr[2]); - pwrapper=dptr[1]; pptr=dptr[0]; plen=dptr[2]; + pwrapper=dptr[1]; pptr=dptr[0]; plen=dptr[2]; } else { pwrapper=0x62924910; switch(dptr[1]){ case 0x629248d0: dptr=0x62b672c0;dptr+=2*(reg->eax&65535); // printf("FUNC: ptr2=%p eax=%p edx=%p\n",0x62924910,dptr[0],dptr[1]); - pptr=dptr[0]; plen=dptr[1]; + pptr=dptr[0]; plen=dptr[1]; break; case 0x62924e40: dptr=0x62b67c70;dptr+=2*(reg->eax&65535); // printf("FUNC: ptr2=%p eax=%p edx=%p\n",0x62924910,dptr[0],dptr[1]); - pptr=dptr[0]; plen=dptr[1]; + pptr=dptr[0]; plen=dptr[1]; break; case 0x62924e60: dptr=0x62b68108;if(reg->eax&0x8000) dptr+=2*(reg->eax|0xffff0000); else dptr+=2*(reg->eax&65535); // printf("FUNC: ptr2=%p eax=%p edx=%p\n",0x62924910,dptr[0],dptr[1]); - pptr=dptr[0]; plen=dptr[1]; + pptr=dptr[0]; plen=dptr[1]; break; case 0x62924e80: dptr=0x62b68108;if(reg->eax&0x8000) dptr+=2*(reg->eax|0xffff0000); else dptr+=2*(reg->eax&65535); // printf("FUNC: ptr2=%p eax=%p edx=%p\n",0x62924910,dptr[0],dptr[1]); - pptr=dptr[0]; plen=dptr[1]; + pptr=dptr[0]; plen=dptr[1]; break; default: printf("FUNC: unknown ptr & psize!\n"); @@ -823,7 +823,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t fflush(stdout); #endif - + #if 1 // emulate some functions: switch(reg->eax){ @@ -914,7 +914,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t } } - // print stack/reg information + // print stack/reg information printf("ENTER(%d) stack = %d bytes @ %p\n" "eax = 0x%08x edx = 0x%08x ebx = 0x%08x ecx = 0x%08x\n" "esp = 0x%08x ebp = 0x%08x esi = 0x%08x edi = 0x%08x\n" @@ -930,15 +930,15 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t ++ret_i; #if 0 - // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) + // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) printf("stack[] = { "); for (i=0;i<7;i++) { printf("%08x ", ((uint32_t *)stack_base)[i]); } printf("}\n\n"); #endif - -// // mess with function parameters + +// // mess with function parameters // ((uint32_t *)stack_base)[1] = 0x66554433; // // mess with return address... @@ -966,7 +966,7 @@ static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint printf("\n"); fflush(stdout); #else - // print stack/reg information + // print stack/reg information printf("LEAVE(%d) stack = %d bytes @ %p\n" "eax = 0x%08x edx = 0x%08x ebx = 0x%08x ecx = 0x%08x\n" "esp = 0x%08x ebp = 0x%08x esi = 0x%08x edi = 0x%08x\n" @@ -978,7 +978,7 @@ static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint #endif #if 0 - // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) + // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) printf("stack[] = { "); for (i=0;i<7;i++) { printf("%08x ", ((uint32_t *)stack_base)[i]); @@ -987,8 +987,8 @@ static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint #endif #endif - -// // mess with function parameters + +// // mess with function parameters // ((uint32_t *)stack_base)[1] = 0x66554433; // // mess with return address... diff --git a/loader/pe_image.c b/loader/pe_image.c index 1b069b82ac..b4bdba90c8 100644 --- a/loader/pe_image.c +++ b/loader/pe_image.c @@ -1,4 +1,4 @@ -/* +/* * Copyright 1994 Eric Youndale & Erik Bos * Copyright 1995 Martin von Löwis * Copyright 1996-98 Marcus Meissner @@ -16,12 +16,12 @@ /* Notes: * Before you start changing something in this file be aware of the following: * - * - There are several functions called recursively. In a very subtle and + * - There are several functions called recursively. In a very subtle and * obscure way. DLLs can reference each other recursively etc. * - If you want to enhance, speed up or clean up something in here, think * twice WHY it is implemented in that strange way. There is usually a reason. * Though sometimes it might just be lazyness ;) - * - In PE_MapImage, right before fixup_imports() all external and internal + * - In PE_MapImage, right before fixup_imports() all external and internal * state MUST be correct since this function can be called with the SAME image * AGAIN. (Thats recursion for you.) That means MODREF.module and * NE_MODULE.module32. @@ -69,7 +69,7 @@ #define AdjustPtr(ptr,delta) ((char *)(ptr) + (delta)) static void dump_exports( HMODULE hModule ) -{ +{ char *Module; unsigned int i, j; unsigned short *ordinal; @@ -85,7 +85,7 @@ static void dump_exports( HMODULE hModule ) Module = (char*)RVA(pe_exports->Name); TRACE("*******EXPORT DATA*******\n"); - TRACE("Module name is %s, %ld functions, %ld names\n", + TRACE("Module name is %s, %ld functions, %ld names\n", Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames); ordinal=(unsigned short*) RVA(pe_exports->AddressOfNameOrdinals); @@ -95,11 +95,11 @@ static void dump_exports( HMODULE hModule ) TRACE(" Ord RVA Addr Name\n" ); for (i=0;i<pe_exports->NumberOfFunctions;i++, function++) { - if (!*function) continue; + if (!*function) continue; if (TRACE_ON(win32)) { dbg_printf( "%4ld %08lx %p", i + pe_exports->Base, *function, RVA(*function) ); - + for (j = 0; j < pe_exports->NumberOfNames; j++) if (ordinal[j] == i) { @@ -115,15 +115,15 @@ static void dump_exports( HMODULE hModule ) /* Look up the specified function or ordinal in the exportlist: * If it is a string: - * - look up the name in the Name list. + * - look up the name in the Name list. * - look up the ordinal with that index. * - use the ordinal as offset into the functionlist * If it is a ordinal: * - use ordinal-pe_export->Base as offset into the functionlist */ -FARPROC PE_FindExportedFunction( - WINE_MODREF *wm, - LPCSTR funcName, +FARPROC PE_FindExportedFunction( + WINE_MODREF *wm, + LPCSTR funcName, WIN_BOOL snoop ) { unsigned short * ordinals; @@ -160,7 +160,7 @@ FARPROC PE_FindExportedFunction( if (HIWORD(funcName)) { - + int min = 0, max = exports->NumberOfNames - 1; while (min <= max) { @@ -174,7 +174,7 @@ FARPROC PE_FindExportedFunction( if (res > 0) max = pos - 1; else min = pos + 1; } - + for (i = 0; i < exports->NumberOfNames; i++) { ename = (const char*) RVA(name[i]); @@ -187,10 +187,10 @@ FARPROC PE_FindExportedFunction( } return NULL; } - else + else { ordinal = LOWORD(funcName) - exports->Base; - if (snoop && name) + if (snoop && name) { for (i = 0; i < exports->NumberOfNames; i++) if (ordinals[i] == ordinal) @@ -217,11 +217,11 @@ FARPROC PE_FindExportedFunction( if (!ename) ename = "@"; // proc = SNOOP_GetProcAddress(wm->module,ename,ordinal,proc); TRACE("SNOOP_GetProcAddress n/a\n"); - + } return proc; } - else + else { WINE_MODREF *wm; char *forward = RVA(addr); @@ -248,7 +248,7 @@ static DWORD fixup_imports( WINE_MODREF *wm ) unsigned int load_addr = wm->module; int i,characteristics_detection=1; char *modname; - + assert(wm->type==MODULE32_PE); pem = &(wm->binfmt.pe); if (pem->pe_export) @@ -256,10 +256,10 @@ static DWORD fixup_imports( WINE_MODREF *wm ) else modname = "<unknown>"; - + TRACE("Dumping imports list\n"); - + pe_imp = pem->pe_import; if (!pe_imp) return 0; @@ -274,16 +274,16 @@ static DWORD fixup_imports( WINE_MODREF *wm ) break; i++; } - if (!i) return 0; + if (!i) return 0; + - wm->nDeps = i; wm->deps = HeapAlloc( GetProcessHeap(), 0, i*sizeof(WINE_MODREF *) ); - /* load the imported modules. They are automatically + /* load the imported modules. They are automatically * added to the modref list of the process. */ - + for (i = 0, pe_imp = pem->pe_import; pe_imp->Name ; pe_imp++) { IMAGE_IMPORT_BY_NAME *pe_name; PIMAGE_THUNK_DATA import_list,thunk_list; @@ -294,8 +294,8 @@ static DWORD fixup_imports( WINE_MODREF *wm ) //#warning FIXME: here we should fill imports TRACE("Loading imports for %s.dll\n", name); - - if (pe_imp->u.OriginalFirstThunk != 0) { + + if (pe_imp->u.OriginalFirstThunk != 0) { TRACE("Microsoft style imports used\n"); import_list =(PIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk); thunk_list = (PIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk); @@ -305,9 +305,9 @@ static DWORD fixup_imports( WINE_MODREF *wm ) int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal); // TRACE("--- Ordinal %s,%d\n", name, ordinal); - + thunk_list->u1.Function=LookupExternal(name, ordinal); - } else { + } else { pe_name = (PIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData); // TRACE("--- %s %s.%d\n", pe_name->Name, name, pe_name->Hint); thunk_list->u1.Function=LookupExternalByName(name, pe_name->Name); @@ -315,12 +315,12 @@ static DWORD fixup_imports( WINE_MODREF *wm ) import_list++; thunk_list++; } - } else { + } else { TRACE("Borland style imports used\n"); thunk_list = (PIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk); while (thunk_list->u1.Ordinal) { if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) { - + int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal); TRACE("--- Ordinal %s.%d\n",name,ordinal); @@ -349,8 +349,8 @@ static int calc_vma_size( HMODULE hModule ) TRACE(" Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n"); for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++) { - TRACE("%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n", - pe_seg->Name, + TRACE("%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n", + pe_seg->Name, pe_seg->Misc.VirtualSize, pe_seg->VirtualAddress, pe_seg->SizeOfRawData, @@ -374,7 +374,7 @@ static void do_relocations( unsigned int load_addr, IMAGE_BASE_RELOCATION *r ) int ldelta = delta & 0xFFFF; if(delta == 0) - + return; while(r->VirtualAddress) { @@ -383,7 +383,7 @@ static void do_relocations( unsigned int load_addr, IMAGE_BASE_RELOCATION *r ) int i; TRACE_(fixup)("%x relocations for page %lx\n", count, r->VirtualAddress); - + for(i=0;i<count;i++) { int offset = r->TypeOffset[i] & 0xFFF; @@ -400,7 +400,7 @@ static void do_relocations( unsigned int load_addr, IMAGE_BASE_RELOCATION *r ) break; case IMAGE_REL_BASED_HIGHLOW: *(int*)(page+offset) += delta; - + break; case IMAGE_REL_BASED_HIGHADJ: FIXME("Don't know what to do with IMAGE_REL_BASED_HIGHADJ\n"); @@ -416,16 +416,16 @@ static void do_relocations( unsigned int load_addr, IMAGE_BASE_RELOCATION *r ) r = (IMAGE_BASE_RELOCATION*)((char*)r + r->SizeOfBlock); } } - - - + + + /********************************************************************** * PE_LoadImage * Load one PE format DLL/EXE into memory - * - * Unluckily we can't just mmap the sections where we want them, for + * + * Unluckily we can't just mmap the sections where we want them, for * (at least) Linux does only support offsets which are page-aligned. * * BUT we have to map the whole image anyway, for Win32 programs sometimes @@ -446,9 +446,9 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) int unix_handle = handle; int page_size = getpagesize(); - -// if ( GetFileInformationByHandle( hFile, &bhfi ) ) -// file_size = bhfi.nFileSizeLow; + +// if ( GetFileInformationByHandle( hFile, &bhfi ) ) +// file_size = bhfi.nFileSizeLow; file_size=lseek(handle, 0, SEEK_END); lseek(handle, 0, SEEK_SET); @@ -476,14 +476,14 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) nt = PE_HEADER( hModule ); - + if ( nt->Signature != IMAGE_NT_SIGNATURE ) { WARN("%s image doesn't have PE signature, but 0x%08lx\n", filename, nt->Signature ); goto error; } - + if ( nt->FileHeader.Machine != IMAGE_FILE_MACHINE_I386 ) { dbg_printf("Trying to load PE image for unsupported architecture ("); @@ -502,10 +502,10 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) goto error; } - + pe_sec = PE_SECTIONS( hModule ); rawsize = 0; lowest_va = 0x10000; - for (i = 0; i < nt->FileHeader.NumberOfSections; i++) + for (i = 0; i < nt->FileHeader.NumberOfSections; i++) { if (lowest_va > pe_sec[i].VirtualAddress) lowest_va = pe_sec[i].VirtualAddress; @@ -514,17 +514,17 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) if (pe_sec[i].PointerToRawData+pe_sec[i].SizeOfRawData > rawsize) rawsize = pe_sec[i].PointerToRawData+pe_sec[i].SizeOfRawData; } - - + + if ( file_size && file_size < rawsize ) { ERR("PE module is too small (header: %d, filesize: %d), " - "probably truncated download?\n", + "probably truncated download?\n", rawsize, file_size ); goto error; } - + aoep = nt->OptionalHeader.AddressOfEntryPoint; if (aoep && (aoep < lowest_va)) FIXME("VIRUS WARNING: '%s' has an invalid entrypoint (0x%08lx) " @@ -546,11 +546,11 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) if ( nt->OptionalHeader.ImageBase & 0x80000000 && !strstr(filename, "xanlib.dll")) { - HMODULE sharedMod = (HMODULE)nt->OptionalHeader.ImageBase; + HMODULE sharedMod = (HMODULE)nt->OptionalHeader.ImageBase; IMAGE_NT_HEADERS *sharedNt = (PIMAGE_NT_HEADERS) ( (LPBYTE)sharedMod + ((LPBYTE)nt - (LPBYTE)hModule) ); - /* Well, this check is not really comprehensive, + /* Well, this check is not really comprehensive, but should be good enough for now ... */ if ( !IsBadReadPtr( (LPBYTE)sharedMod, sizeof(IMAGE_DOS_HEADER) ) && memcmp( (LPBYTE)sharedMod, (LPBYTE)hModule, sizeof(IMAGE_DOS_HEADER) ) == 0 @@ -563,21 +563,21 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) } - + load_addr = nt->OptionalHeader.ImageBase; vma_size = calc_vma_size( hModule ); load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE ); - if (load_addr == 0) + if (load_addr == 0) { - + FIXME("We need to perform base relocations for %s\n", filename); dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_BASERELOC; if (dir->Size) reloc = dir->VirtualAddress; - else + else { FIXME( "FATAL: Need to relocate %s, but no relocation records present (%s). Try to run that file directly !\n", filename, @@ -609,13 +609,13 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) filename, load_addr, vma_size ); #if 0 - + *(PIMAGE_DOS_HEADER)load_addr = *(PIMAGE_DOS_HEADER)hModule; *PE_HEADER( load_addr ) = *nt; memcpy( PE_SECTIONS(load_addr), PE_SECTIONS(hModule), sizeof(IMAGE_SECTION_HEADER) * nt->FileHeader.NumberOfSections ); - + memcpy( load_addr, hModule, lowest_fa ); #endif @@ -623,11 +623,11 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) 0, 0, PROT_EXEC | PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_FIXED ) != (void*)load_addr) { - ERR_(win32)( "Critical Error: failed to map PE header to necessary address.\n"); + ERR_(win32)( "Critical Error: failed to map PE header to necessary address.\n"); goto error; } - + pe_sec = PE_SECTIONS( hModule ); for (i = 0; i < nt->FileHeader.NumberOfSections; i++, pe_sec++) { @@ -640,7 +640,7 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) PROT_EXEC | PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_FIXED ) != (void*)RVA(pe_sec->VirtualAddress)) { - + ERR_(win32)( "Critical Error: failed to map PE section to necessary address.\n"); goto error; } @@ -657,21 +657,21 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version ) } } - + if ( reloc ) do_relocations( load_addr, (IMAGE_BASE_RELOCATION *)RVA(reloc) ); - + *version = ( (nt->OptionalHeader.MajorSubsystemVersion & 0xff) << 8 ) | (nt->OptionalHeader.MinorSubsystemVersion & 0xff); - + UnmapViewOfFile( (LPVOID)hModule ); return (HMODULE)load_addr; error: if (unix_handle != -1) close( unix_handle ); - if (load_addr) + if (load_addr) VirtualFree( (LPVOID)load_addr, 0, MEM_RELEASE ); UnmapViewOfFile( (LPVOID)hModule ); return 0; @@ -690,10 +690,10 @@ error: * Note: This routine must always be called in the context of the * process that is to own the module to be created. */ -WINE_MODREF *PE_CreateModule( HMODULE hModule, +WINE_MODREF *PE_CreateModule( HMODULE hModule, LPCSTR filename, DWORD flags, WIN_BOOL builtin ) { - DWORD load_addr = (DWORD)hModule; + DWORD load_addr = (DWORD)hModule; IMAGE_NT_HEADERS *nt = PE_HEADER(hModule); IMAGE_DATA_DIRECTORY *dir; IMAGE_IMPORT_DESCRIPTOR *pe_import = NULL; @@ -702,7 +702,7 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, WINE_MODREF *wm; - + dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_EXPORT; if (dir->Size) @@ -722,8 +722,8 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_SECURITY; if (dir->Size) FIXME("Security directory ignored\n" ); - - + + dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_DEBUG; if (dir->Size) TRACE("Debug directory ignored\n" ); @@ -734,7 +734,7 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_GLOBALPTR; if (dir->Size) FIXME("Global Pointer (MIPS) ignored\n" ); - + dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG; if (dir->Size) FIXME("Load Configuration directory ignored\n" ); @@ -769,7 +769,7 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, TRACE_(delayhlp)("pe_delay->pUnloadIAT = %08x\n", pe_delay->pUnloadIAT); TRACE_(delayhlp)("pe_delay->dwTimeStamp = %08x\n", pe_delay->dwTimeStamp); } -#endif +#endif } dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR; @@ -779,13 +779,13 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, if (dir->Size) FIXME("Unknown directory 15 ignored\n" ); - - wm = (WINE_MODREF *)HeapAlloc( GetProcessHeap(), + + wm = (WINE_MODREF *)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wm) ); wm->module = hModule; - if ( builtin ) + if ( builtin ) wm->flags |= WINE_MODREF_INTERNAL; if ( flags & DONT_RESOLVE_DLL_REFERENCES ) wm->flags |= WINE_MODREF_DONT_RESOLVE_REFS; @@ -811,8 +811,8 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, if ( pe_import && !( wm->flags & WINE_MODREF_LOAD_AS_DATAFILE ) - && !( wm->flags & WINE_MODREF_DONT_RESOLVE_REFS ) - && fixup_imports( wm ) ) + && !( wm->flags & WINE_MODREF_DONT_RESOLVE_REFS ) + && fixup_imports( wm ) ) { /* remove entry from modref chain */ return NULL; @@ -822,7 +822,7 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, } /****************************************************************************** - * The PE Library Loader frontend. + * The PE Library Loader frontend. * FIXME: handle the flags. */ WINE_MODREF *PE_LoadLibraryExA (LPCSTR name, DWORD flags) @@ -833,17 +833,17 @@ WINE_MODREF *PE_LoadLibraryExA (LPCSTR name, DWORD flags) int hFile; WORD version = 0; - - strncpy(filename, name, sizeof(filename)); + + strncpy(filename, name, sizeof(filename)); hFile=open(filename, O_RDONLY); if(hFile==-1) return NULL; - - + + hModule32 = PE_LoadImage( hFile, filename, &version ); if (!hModule32) { - SetLastError( ERROR_OUTOFMEMORY ); + SetLastError( ERROR_OUTOFMEMORY ); return NULL; } @@ -917,7 +917,7 @@ WIN_BOOL PE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved ) WIN_BOOL retv = TRUE; assert( wm->type == MODULE32_PE ); - + if ((PE_HEADER(wm->module)->FileHeader.Characteristics & IMAGE_FILE_DLL) && (PE_HEADER(wm->module)->OptionalHeader.AddressOfEntryPoint) ) { @@ -925,11 +925,11 @@ WIN_BOOL PE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved ) entry = (void*)PE_FindExportedFunction(wm, "DllMain", 0); if(entry==NULL) entry = (void*)RVA_PTR( wm->module,OptionalHeader.AddressOfEntryPoint ); - + TRACE_(relay)("CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n", entry, wm->module, type, lpReserved ); - - + + TRACE("Entering DllMain("); switch(type) { @@ -945,7 +945,7 @@ WIN_BOOL PE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved ) case DLL_THREAD_ATTACH: TRACE("DLL_THREAD_ATTACH) "); break; - } + } TRACE("for %s\n", wm->filename); extend_stack_for_dll_alloca(); retv = entry( wm->module, type, lpReserved ); diff --git a/loader/pe_resource.c b/loader/pe_resource.c index 054bdd58de..b818adb2a8 100644 --- a/loader/pe_resource.c +++ b/loader/pe_resource.c @@ -29,7 +29,7 @@ #include "ext.h" /********************************************************************** - * HMODULE32toPE_MODREF + * HMODULE32toPE_MODREF * * small helper function to get a PE_MODREF from a passed HMODULE32 */ @@ -65,13 +65,13 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY resdirptr, return GetResDirEntryW(resdirptr,(LPCWSTR)atoi(buf),root,allowdefault); } entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) ( - (BYTE *) resdirptr + + (BYTE *) resdirptr + sizeof(IMAGE_RESOURCE_DIRECTORY)); namelen = lstrlenW(name); for (entrynum = 0; entrynum < resdirptr->NumberOfNamedEntries; entrynum++) { PIMAGE_RESOURCE_DIR_STRING_U str = - (PIMAGE_RESOURCE_DIR_STRING_U) (root + + (PIMAGE_RESOURCE_DIR_STRING_U) (root + entryTable[entrynum].u1.s.NameOffset); if(namelen != str->Length) continue; @@ -83,7 +83,7 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY resdirptr, return NULL; } else { entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) ( - (BYTE *) resdirptr + + (BYTE *) resdirptr + sizeof(IMAGE_RESOURCE_DIRECTORY) + resdirptr->NumberOfNamedEntries * sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)); for (entrynum = 0; entrynum < resdirptr->NumberOfIdEntries; entrynum++) @@ -108,7 +108,7 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA( PIMAGE_RESOURCE_DIRECTORY resdirptr, WIN_BOOL allowdefault ) { PIMAGE_RESOURCE_DIRECTORY retv; - LPWSTR nameW = HIWORD(name)? HEAP_strdupAtoW( GetProcessHeap(), 0, name ) + LPWSTR nameW = HIWORD(name)? HEAP_strdupAtoW( GetProcessHeap(), 0, name ) : (LPWSTR)name; retv = GetResDirEntryW( resdirptr, nameW, root, allowdefault ); @@ -178,7 +178,7 @@ PE_EnumResourceTypesA(HMODULE hmod,ENUMRESTYPEPROCA lpfun,LONG lparam) { PIMAGE_RESOURCE_DIRECTORY resdir; PIMAGE_RESOURCE_DIRECTORY_ENTRY et; WIN_BOOL ret; - HANDLE heap = GetProcessHeap(); + HANDLE heap = GetProcessHeap(); if (!pem || !pem->pe_resource) return FALSE; @@ -245,7 +245,7 @@ PE_EnumResourceNamesA( PIMAGE_RESOURCE_DIRECTORY resdir; PIMAGE_RESOURCE_DIRECTORY_ENTRY et; WIN_BOOL ret; - HANDLE heap = GetProcessHeap(); + HANDLE heap = GetProcessHeap(); LPWSTR typeW; if (!pem || !pem->pe_resource) @@ -325,7 +325,7 @@ PE_EnumResourceLanguagesA( PIMAGE_RESOURCE_DIRECTORY resdir; PIMAGE_RESOURCE_DIRECTORY_ENTRY et; WIN_BOOL ret; - HANDLE heap = GetProcessHeap(); + HANDLE heap = GetProcessHeap(); LPWSTR nameW,typeW; if (!pem || !pem->pe_resource) diff --git a/loader/qtx/list.c b/loader/qtx/list.c index 4669067d30..0140f9b954 100644 --- a/loader/qtx/list.c +++ b/loader/qtx/list.c @@ -16,7 +16,7 @@ void* GetProcAddress(void* handle,char* func); #define __stdcall __attribute__((__stdcall__)) #define __cdecl __attribute__((__cdecl__)) -#define APIENTRY +#define APIENTRY int main(void) { void *handler; @@ -51,7 +51,7 @@ int main(void) { desc.componentManufacturer=0; desc.componentFlags=0; desc.componentFlagsMask=0; - + printf("Count = %ld\n",CountComponents(&desc)); exit(0); diff --git a/loader/qtx/qtxload.c b/loader/qtx/qtxload.c index 8767559aa1..fe95ac87a5 100644 --- a/loader/qtx/qtxload.c +++ b/loader/qtx/qtxload.c @@ -27,7 +27,7 @@ void* GetProcAddress(void* handle,char* func); #define __stdcall __attribute__((__stdcall__)) #define __cdecl __attribute__((__cdecl__)) -#define APIENTRY +#define APIENTRY unsigned int* x_table[0x00001837]; @@ -60,7 +60,7 @@ int main(void) { InitializeQTML = 0x6299e590;//GetProcAddress(handler, "InitializeQTML"); InitializeQTML(6+16); - + printf("loading svq3\n"); handler2= LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime/QuickTimeEssentials.qtx"); printf("done\n"); @@ -82,7 +82,7 @@ int main(void) { desc.componentManufacturer=0; desc.componentFlags=0; desc.componentFlagsMask=0; - + params = malloc(sizeof(ComponentParameters)+2048); params->flags = 0; diff --git a/loader/qtx/qtxsdk/components.h b/loader/qtx/qtxsdk/components.h index e1415a94cd..0856e279f4 100644 --- a/loader/qtx/qtxsdk/components.h +++ b/loader/qtx/qtxsdk/components.h @@ -704,13 +704,13 @@ static inline void dump_CodecDecompressParams(void* xxx){ printf("sequenceID=%d\n",cd->sequenceID); idh=cd->imageDescription; if(idh && idh[0]) dump_ImageDescription(idh[0]); - + for(i=0;i<sizeof(CodecDecompressParams);i++){ printf(" %02X",((unsigned char*)cd)[i]); if((i%16)==15) printf("\n"); } printf("\n"); - + printf("data=%p size=%d\n",cd->data,cd->bufferSize); printf("frameno=%d lines: %d .. %d condflags=0x%X callerflags=0x%X\n", cd->frameNumber, cd->startLine, cd->stopLine, cd->conditionFlags,cd->callerFlags); diff --git a/loader/resource.c b/loader/resource.c index 7174419936..c15b308c69 100644 --- a/loader/resource.c +++ b/loader/resource.c @@ -52,14 +52,14 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, LPCSTR name, WORD lang, int unicode) { HRSRC hRsrc = 0; - LPWSTR typeStr, nameStr; + LPWSTR typeStr, nameStr; WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule ); if(!wm) - return 0; + return 0; /* 32-bit PE module */ - + if ( HIWORD( type ) && (!unicode)) typeStr = HEAP_strdupAtoW( GetProcessHeap(), 0, type ); else @@ -68,12 +68,12 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, nameStr = HEAP_strdupAtoW( GetProcessHeap(), 0, name ); else nameStr = (LPWSTR)name; - + hRsrc = PE_FindResourceExW( wm, nameStr, typeStr, lang ); - - if ( HIWORD( type ) && (!unicode)) + + if ( HIWORD( type ) && (!unicode)) HeapFree( GetProcessHeap(), 0, typeStr ); - if ( HIWORD( name ) && (!unicode)) + if ( HIWORD( name ) && (!unicode)) HeapFree( GetProcessHeap(), 0, nameStr ); return hRsrc; @@ -111,7 +111,7 @@ static DWORD RES_SizeofResource( HMODULE hModule, HRSRC hRsrc) // HMODULE16 hMod16 = MapHModuleLS( hModule ); // NE_MODULE *pModule = NE_GetPtr( hMod16 ); -// WINE_MODREF *wm = pModule && pModule->module32? +// WINE_MODREF *wm = pModule && pModule->module32? // MODULE32_LookupHMODULE( pModule->module32 ) : NULL; // WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule ); @@ -124,7 +124,7 @@ static DWORD RES_SizeofResource( HMODULE hModule, HRSRC hRsrc) { printf("16-bit hRsrcs not supported\n"); return 0; - } + } size = PE_SizeofResource( hModule, hRsrc ); return size; } @@ -201,29 +201,29 @@ static WIN_BOOL RES_FreeResource( HGLOBAL handle ) */ HANDLE WINAPI FindResourceA( HMODULE hModule, LPCSTR name, LPCSTR type ) { - return RES_FindResource( hModule, type, name, + return RES_FindResource( hModule, type, name, WINE_LanguageId, 0); } HANDLE WINAPI FindResourceW( HMODULE hModule, LPCWSTR name, LPCWSTR type ) { - return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, + return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, WINE_LanguageId, 1); } /********************************************************************** * FindResourceExA (KERNEL32.129) */ -HANDLE WINAPI FindResourceExA( HMODULE hModule, +HANDLE WINAPI FindResourceExA( HMODULE hModule, LPCSTR type, LPCSTR name, WORD lang ) { - return RES_FindResource( hModule, type, name, + return RES_FindResource( hModule, type, name, lang, 0 ); } -HANDLE WINAPI FindResourceExW( HMODULE hModule, +HANDLE WINAPI FindResourceExW( HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang ) { - return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, + return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, lang, 1 ); } @@ -333,21 +333,21 @@ INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id, TRACE("instance = %04x, id = %04x, buffer = %08x, " "length = %d\n", instance, (int)resource_id, (int) buffer, buflen); - /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out + /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out * 20 - 31. */ hrsrc = FindResourceW( instance, (LPCWSTR)(((resource_id>>4)&0xffff)+1), RT_STRINGW ); if (!hrsrc) return 0; hmem = LoadResource( instance, hrsrc ); if (!hmem) return 0; - + p = (WCHAR*) LockResource(hmem); string_num = resource_id & 0x000f; for (i = 0; i < string_num; i++) p += *p + 1; - + TRACE("strlen = %d\n", (int)*p ); - + if (buffer == NULL) return *p; i = min(buflen - 1, *p); if (i > 0) { @@ -368,10 +368,10 @@ INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id, } /* Messages...used by FormatMessage32* (KERNEL32.something) - * + * * They can be specified either directly or using a message ID and * loading them from the resource. - * + * * The resourcedata has following format: * start: * 0: DWORD nrofentries @@ -409,7 +409,7 @@ INT WINAPI LoadMessageA( HMODULE instance, UINT id, WORD lang, if (!hrsrc) return 0; hmem = LoadResource( instance, hrsrc ); if (!hmem) return 0; - + mrd = (PMESSAGE_RESOURCE_DATA)LockResource(hmem); mre = NULL; mrb = &(mrd->Blocks[0]); diff --git a/loader/vfl.c b/loader/vfl.c index 7b0f10ea77..b0ce80acfd 100644 --- a/loader/vfl.c +++ b/loader/vfl.c @@ -66,7 +66,7 @@ ICOpen(long filename,long fccHandler,unsigned int wMode) { HDRVR hdrv; WINE_HIC *whic; - /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the + /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the * same layout as ICOPEN */ icopen.fccType = 0x63646976; // "vidc" //fccType; @@ -93,7 +93,7 @@ ICGetInfo(HIC hic,ICINFO *picinfo,long cb) { LRESULT ret; ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb); - + return ret; } @@ -129,7 +129,7 @@ ICCompress( /*********************************************************************** * ICDecompress [MSVFW.26] */ -long VFWAPIV +long VFWAPIV ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) { ICDECOMPRESS icd; int result; @@ -147,11 +147,11 @@ ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPB /*********************************************************************** * ICDecompressEx [MSVFW.26] */ -long VFWAPIV +long VFWAPIV ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) { ICDECOMPRESSEX icd; int result; - + icd.dwFlags = dwFlags; icd.lpbiSrc = lpbiFormat; @@ -159,7 +159,7 @@ ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,L icd.lpbiDst = lpbi; icd.lpDst = lpBits; - + icd.xSrc=icd.ySrc=0; icd.dxSrc=lpbiFormat->biWidth; icd.dySrc=abs(lpbiFormat->biHeight); @@ -167,17 +167,17 @@ ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,L icd.xDst=icd.yDst=0; icd.dxDst=lpbi->biWidth; icd.dyDst=abs(lpbi->biHeight); - + //icd.ckid = 0; result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd)); return result; } -long VFWAPIV +long VFWAPIV ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) { ICDECOMPRESSEX icd; int result; - + icd.dwFlags = 0; icd.lpbiSrc = lpbiFormat; @@ -185,7 +185,7 @@ ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEAD icd.lpbiDst = lpbi; icd.lpDst = 0; - + icd.xSrc=icd.ySrc=0; icd.dxSrc=lpbiFormat->biWidth; icd.dySrc=abs(lpbiFormat->biHeight); @@ -193,7 +193,7 @@ ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEAD icd.xDst=icd.yDst=0; icd.dxDst=lpbi->biWidth; icd.dyDst=abs(lpbi->biHeight); - + //icd.ckid = 0; result=ICSendMessage(hic,command,(long)&icd,sizeof(icd)); return result; diff --git a/loader/win32.c b/loader/win32.c index bf0ad205b9..299a3636d5 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -203,7 +203,7 @@ static inline void dbgprintf(char* fmt, ...) if ( mp_msg_test(MSGT_WIN32,MSGL_DBG3) ) { va_list va; - + va_start(va, fmt); vprintf(fmt, va); // mp_dbg(MSGT_WIN32, MSGL_DBG3, fmt, va); @@ -854,7 +854,7 @@ static void* WINAPI expWaitForMultipleObjects(int count, const void** objects, dbgprintf("WaitForMultipleObjects(%d, 0x%x, %d, duration %d) =>\n", count, objects, WaitAll, duration); - + for (i = 0; i < count; i++) { object = (void *)objects[i]; @@ -877,7 +877,7 @@ static HANDLE WINAPI expCreateMutexA(void *pSecAttr, char bInitialOwner, const char *name) { HANDLE mlist = (HANDLE)expCreateEventA(pSecAttr, 0, 0, name); - + if (name) dbgprintf("CreateMutexA(0x%x, %d, '%s') => 0x%x\n", pSecAttr, bInitialOwner, name, mlist); @@ -1396,7 +1396,7 @@ static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c) dbgprintf("Win32 Warning: Deleting uninitialized Critical Section %p!!\n", c); return; } - + if (cs->locked) { dbgprintf("Win32 Warning: Deleting unlocked Critical Section %p!!\n", c); @@ -2513,7 +2513,7 @@ static int WINAPI expMonitorFromPoint(void *p, int flags) return 0; } -static int WINAPI expEnumDisplayMonitors(void *dc, RECT *r, +static int WINAPI expEnumDisplayMonitors(void *dc, RECT *r, int WINAPI (*callback_proc)(), void *callback_param) { dbgprintf("EnumDisplayMonitors(0x%x, 0x%x, 0x%x, 0x%x) => ?\n", @@ -2523,26 +2523,26 @@ static int WINAPI expEnumDisplayMonitors(void *dc, RECT *r, #if 0 typedef struct tagMONITORINFO { - DWORD cbSize; - RECT rcMonitor; - RECT rcWork; - DWORD dwFlags; -} MONITORINFO, *LPMONITORINFO; + DWORD cbSize; + RECT rcMonitor; + RECT rcWork; + DWORD dwFlags; +} MONITORINFO, *LPMONITORINFO; #endif #define CCHDEVICENAME 8 -typedef struct tagMONITORINFOEX { - DWORD cbSize; - RECT rcMonitor; - RECT rcWork; - DWORD dwFlags; +typedef struct tagMONITORINFOEX { + DWORD cbSize; + RECT rcMonitor; + RECT rcWork; + DWORD dwFlags; TCHAR szDevice[CCHDEVICENAME]; -} MONITORINFOEX, *LPMONITORINFOEX; +} MONITORINFOEX, *LPMONITORINFOEX; static int WINAPI expGetMonitorInfoA(void *mon, LPMONITORINFO lpmi) { dbgprintf("GetMonitorInfoA(0x%x, 0x%x) => 1\n", mon, lpmi); - + lpmi->rcMonitor.right = lpmi->rcWork.right = PSEUDO_SCREEN_WIDTH; lpmi->rcMonitor.left = lpmi->rcWork.left = 0; lpmi->rcMonitor.bottom = lpmi->rcWork.bottom = PSEUDO_SCREEN_HEIGHT; @@ -2556,7 +2556,7 @@ static int WINAPI expGetMonitorInfoA(void *mon, LPMONITORINFO lpmi) dbgprintf("MONITORINFOEX!\n"); strncpy(lpmiex->szDevice, "Monitor1", CCHDEVICENAME); } - + return 1; } @@ -3433,7 +3433,7 @@ static int WINAPI expCreateDirectoryA(const char *pathname, void *sa) buf[0] = '.'; buf[1] = 0; } -#if 0 +#if 0 if (strrchr(pathname, '\\')) mkdir(strcat(strrchr(pathname, '\\')+1, '/'), 666); else @@ -3826,7 +3826,7 @@ static HRESULT WINAPI expCoInitialize( static void WINAPI expCoUninitialize(void) { dbgprintf("CoUninitialize() called\n"); -} +} /* allow static linking */ HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit) @@ -3835,7 +3835,7 @@ HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit) } HRESULT WINAPI CoInitialize(LPVOID lpReserved) { - return expCoInitialize(lpReserved); + return expCoInitialize(lpReserved); } void WINAPI CoUninitialize(void) { @@ -4625,25 +4625,25 @@ static int expDirectDrawCreate(void) } #if 1 -typedef struct tagPALETTEENTRY { - BYTE peRed; - BYTE peGreen; - BYTE peBlue; - BYTE peFlags; -} PALETTEENTRY; +typedef struct tagPALETTEENTRY { + BYTE peRed; + BYTE peGreen; + BYTE peBlue; + BYTE peFlags; +} PALETTEENTRY; /* reversed the first 2 entries */ -typedef struct tagLOGPALETTE { - WORD palNumEntries; - WORD palVersion; - PALETTEENTRY palPalEntry[1]; -} LOGPALETTE; +typedef struct tagLOGPALETTE { + WORD palNumEntries; + WORD palVersion; + PALETTEENTRY palPalEntry[1]; +} LOGPALETTE; static HPALETTE WINAPI expCreatePalette(CONST LOGPALETTE *lpgpl) { HPALETTE test; int i; - + dbgprintf("CreatePalette(%x) => NULL\n", lpgpl); i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY)); @@ -4671,10 +4671,10 @@ static int WINAPI expGetClientRect(HWND win, RECT *r) } #if 0 -typedef struct tagPOINT { - LONG x; - LONG y; -} POINT, *PPOINT; +typedef struct tagPOINT { + LONG x; + LONG y; +} POINT, *PPOINT; #endif static int WINAPI expClientToScreen(HWND win, POINT *p) @@ -4718,7 +4718,7 @@ static void *exprealloc(void *ptr, size_t size) if (!ptr) return my_mreq(size,0); else - return my_realloc(ptr, size); + return my_realloc(ptr, size); } /* Fake GetOpenFileNameA from comdlg32.dll for ViVD codec */ diff --git a/loader/wine/avifmt.h b/loader/wine/avifmt.h index 8522ae508d..0fe347539a 100644 --- a/loader/wine/avifmt.h +++ b/loader/wine/avifmt.h @@ -18,24 +18,24 @@ typedef DWORD FOURCC; #ifdef _MSC_VER #pragma warning(disable:4200) #endif - + /* The following is a short description of the AVI file format. Please * see the accompanying documentation for a full explanation. * * An AVI file is the following RIFF form: * - * RIFF('AVI' + * RIFF('AVI' * LIST('hdrl' * avih(<MainAVIHeader>) * LIST ('strl' * strh(<Stream header>) * strf(<Stream format>) * ... additional header data - * LIST('movi' - * { LIST('rec' + * LIST('movi' + * { LIST('rec' * SubChunk... * ) - * | SubChunk } .... + * | SubChunk } .... * ) * [ <AVIIndex> ] * ) @@ -47,7 +47,7 @@ typedef DWORD FOURCC; * be a BITMAPINFO structure, including palette. For an audio stream, * this should be a WAVEFORMAT (or PCMWAVEFORMAT) structure. * - * The actual data is contained in subchunks within the 'movi' LIST + * The actual data is contained in subchunks within the 'movi' LIST * chunk. The first two characters of each data chunk are the * stream number with which that data is associated. * @@ -62,17 +62,17 @@ typedef DWORD FOURCC; * * The grouping into LIST 'rec' chunks implies only that the contents of * the chunk should be read into memory at the same time. This - * grouping is used for files specifically intended to be played from + * grouping is used for files specifically intended to be played from * CD-ROM. * - * The index chunk at the end of the file should contain one entry for + * The index chunk at the end of the file should contain one entry for * each data chunk in the file. - * + * * Limitations for the current software: * Only one video stream and one audio stream are allowed. * The streams must start at the beginning of the file. * - * + * * To register codec types please obtain a copy of the Multimedia * Developer Registration Kit from: * @@ -153,9 +153,9 @@ typedef WORD TWOCC; (ToHex(((stream) & 0xf0) >> 4)), tcc) /* -** Main AVI File Header -*/ - +** Main AVI File Header +*/ + /* flags for use in <dwFlags> in AVIFileHdr */ #define AVIF_HASINDEX 0x00000010 // Index at end of file? #define AVIF_MUSTUSEINDEX 0x00000020 @@ -178,10 +178,10 @@ typedef struct DWORD dwInitialFrames; DWORD dwStreams; DWORD dwSuggestedBufferSize; - + DWORD dwWidth; DWORD dwHeight; - + DWORD dwReserved[4]; } MainAVIHeader; @@ -193,7 +193,7 @@ typedef struct #define AVISF_VIDEO_PALCHANGES 0x00010000 - + typedef struct { FOURCC fccType; FOURCC fccHandler; @@ -201,7 +201,7 @@ typedef struct { WORD wPriority; WORD wLanguage; DWORD dwInitialFrames; - DWORD dwScale; + DWORD dwScale; DWORD dwRate; /* dwRate / dwScale == samples/second */ DWORD dwStart; DWORD dwLength; /* In units above... */ diff --git a/loader/wine/driver.h b/loader/wine/driver.h index a5aa6304b3..e10934bc28 100644 --- a/loader/wine/driver.h +++ b/loader/wine/driver.h @@ -80,7 +80,7 @@ typedef struct CHAR szAliasName[128]; } DRIVERINFOSTRUCT16, *LPDRIVERINFOSTRUCT16; -LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, +LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, LPARAM dwParam1, LPARAM dwParam2); LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hdrvr, UINT Msg, LPARAM lParam1, LPARAM lParam2); diff --git a/loader/wine/ldt.h b/loader/wine/ldt.h index fb4c5351ff..e3f511b062 100644 --- a/loader/wine/ldt.h +++ b/loader/wine/ldt.h @@ -27,7 +27,7 @@ typedef struct enum seg_type type; /* segment type */ } ldt_entry; #ifdef __cplusplus -extern "C" +extern "C" { #endif void LDT_BytesToEntry( const unsigned long *buffer, ldt_entry *content ); diff --git a/loader/wine/mmreg.h b/loader/wine/mmreg.h index 5f6b460ef5..4ab6b7a2ff 100644 --- a/loader/wine/mmreg.h +++ b/loader/wine/mmreg.h @@ -47,7 +47,7 @@ typedef struct __attribute__((__packed__)) WAVEFILTER_ECHO { DWORD dwDelay; } ECHOWAVEFILTER, *PECHOWAVEFILTER, *NPECHOWAVEFILTER, *LPECHOWAVEFILTER; #endif /* WAVEFILTER_ECHO */ - + #ifndef _WAVEFORMATEX_ #define _WAVEFORMATEX_ typedef struct __attribute__((__packed__)) WAVEFORMATEX { diff --git a/loader/wine/module.h b/loader/wine/module.h index cba53f61a1..9db4c9808c 100644 --- a/loader/wine/module.h +++ b/loader/wine/module.h @@ -48,7 +48,7 @@ typedef struct FARPROC16 BootApp; /* startup procedure */ FARPROC16 LoadAppSeg; /* procedure to load a segment */ FARPROC16 reserved2; - FARPROC16 MyAlloc; /* memory allocation procedure, + FARPROC16 MyAlloc; /* memory allocation procedure, * wine must write this field */ FARPROC16 EntryAddrProc; FARPROC16 ExitProc; /* exit procedure */ @@ -65,7 +65,7 @@ typedef struct SEGPTR reserved WINE_PACKED; } LOADPARAMS16; -typedef struct +typedef struct { LPSTR lpEnvAddress; LPSTR lpCmdLine; diff --git a/loader/wine/msacm.h b/loader/wine/msacm.h index 5e3b0df79b..6a0be7c068 100644 --- a/loader/wine/msacm.h +++ b/loader/wine/msacm.h @@ -339,7 +339,7 @@ typedef struct ACMFILTERCHOOSEA DWORD fdwEnum; PWAVEFILTER pwfltrEnum; - + HINSTANCE hInstance; LPCSTR pszTemplateName; LPARAM lCustData; @@ -365,7 +365,7 @@ typedef struct ACMFILTERCHOOSEW DWORD fdwEnum; PWAVEFILTER pwfltrEnum; - + HINSTANCE hInstance; LPCWSTR pszTemplateName; LPARAM lCustData; @@ -391,7 +391,7 @@ typedef struct ACMFILTERCHOOSE16 DWORD fdwEnum; LPWAVEFILTER pwfltrEnum; - + HINSTANCE16 hInstance; LPCSTR pszTemplateName; LPARAM lCustData; @@ -468,22 +468,22 @@ typedef struct ACMFORMATCHOOSEA { DWORD cbStruct; DWORD fdwStyle; - + HWND hwndOwner; PWAVEFORMATEX pwfx; DWORD cbwfx; LPCSTR pszTitle; - + CHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]; - CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; + CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; LPSTR pszName; DWORD cchName; DWORD fdwEnum; PWAVEFORMATEX pwfxEnum; - + HINSTANCE hInstance; LPCSTR pszTemplateName; LPARAM lCustData; @@ -494,22 +494,22 @@ typedef struct ACMFORMATCHOOSEW { DWORD cbStruct; DWORD fdwStyle; - + HWND hwndOwner; PWAVEFORMATEX pwfx; DWORD cbwfx; LPCWSTR pszTitle; - + WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]; - WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; + WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; LPWSTR pszName; DWORD cchName; DWORD fdwEnum; LPWAVEFORMATEX pwfxEnum; - + HINSTANCE hInstance; LPCWSTR pszTemplateName; LPARAM lCustData; @@ -520,22 +520,22 @@ typedef struct ACMFORMATCHOOSE16 { DWORD cbStruct; DWORD fdwStyle; - + HWND16 hwndOwner; LPWAVEFORMATEX pwfx; DWORD cbwfx; LPCSTR pszTitle; - + CHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]; - CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; + CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; LPSTR pszName; DWORD cchName; DWORD fdwEnum; LPWAVEFORMATEX pwfxEnum; - + HINSTANCE16 hInstance; LPCSTR pszTemplateName; LPARAM lCustData; @@ -744,7 +744,7 @@ MMRESULT16 WINAPI acmFormatEnum16( ACMFORMATENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum ); MMRESULT16 WINAPI acmFormatSuggest16( - HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc, + HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest ); MMRESULT16 WINAPI acmFilterTagDetails16( @@ -774,7 +774,7 @@ MMRESULT16 WINAPI acmStreamClose16( HACMSTREAM16 has, DWORD fdwClose ); MMRESULT16 WINAPI acmStreamSize16( - HACMSTREAM16 has, DWORD cbInput, + HACMSTREAM16 has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize ); MMRESULT16 WINAPI acmStreamConvert16( @@ -842,11 +842,11 @@ MMRESULT WINAPI acmFilterDetailsW( HACMDRIVER had, PACMFILTERDETAILSW pafd, DWORD fdwDetails ); MMRESULT WINAPI acmFilterEnumA( - HACMDRIVER had, PACMFILTERDETAILSA pafd, + HACMDRIVER had, PACMFILTERDETAILSA pafd, ACMFILTERENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum ); MMRESULT WINAPI acmFilterEnumW( - HACMDRIVER had, PACMFILTERDETAILSW pafd, + HACMDRIVER had, PACMFILTERDETAILSW pafd, ACMFILTERENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum ); MMRESULT WINAPI acmFilterTagDetailsA( @@ -927,7 +927,7 @@ MMRESULT WINAPI acmStreamReset( HACMSTREAM has, DWORD fdwReset ); MMRESULT WINAPI acmStreamSize( - HACMSTREAM has, DWORD cbInput, + HACMSTREAM has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize ); MMRESULT WINAPI acmStreamUnprepareHeader( diff --git a/loader/wine/msacmdrv.h b/loader/wine/msacmdrv.h index a80587060e..b830eeff2a 100644 --- a/loader/wine/msacmdrv.h +++ b/loader/wine/msacmdrv.h @@ -19,7 +19,7 @@ #define MAKE_ACM_VERSION(mjr, mnr, bld) \ (((long)(mjr)<<24) | ((long)(mnr)<<16) | ((long)bld)) -#define ACMDRVOPENDESC_SECTIONNAME_CHARS +#define ACMDRVOPENDESC_SECTIONNAME_CHARS #define ACMDM_DRIVER_NOTIFY (ACMDM_BASE + 1) #define ACMDM_DRIVER_DETAILS (ACMDM_BASE + 10) diff --git a/loader/wine/ntdef.h b/loader/wine/ntdef.h index 189ba0a922..9e68828bbf 100644 --- a/loader/wine/ntdef.h +++ b/loader/wine/ntdef.h @@ -10,7 +10,7 @@ extern "C" { #endif -#define NTAPI __stdcall +#define NTAPI __stdcall #ifndef IN #define IN @@ -32,7 +32,7 @@ typedef LONG NTSTATUS; typedef NTSTATUS *PNTSTATUS; typedef short CSHORT; -typedef CSHORT *PCSHORT; +typedef CSHORT *PCSHORT; typedef WCHAR * PWCHAR; diff --git a/loader/wine/vfw.h b/loader/wine/vfw.h index e663129c82..a3b05daff3 100644 --- a/loader/wine/vfw.h +++ b/loader/wine/vfw.h @@ -41,8 +41,8 @@ typedef struct { } BITMAPINFO, *LPBITMAPINFO; #endif -#define VFWAPI -#define VFWAPIV +#define VFWAPI +#define VFWAPIV #ifndef MPLAYER_WINDEF_H typedef long (__stdcall__ *DRIVERPROC)(long,HDRVR,unsigned int,long,long); #endif @@ -229,14 +229,14 @@ long VFWAPIV ICCompress( ICSendMessage( \ hic, ICM_GETDEFAULTKEYFRAMERATE, \ (long)(void*)(lpint), \ - 0 ) + 0 ) #define ICGetDefaultQuality(hic,lpint) \ ICSendMessage( \ hic, ICM_GETDEFAULTQUALITY, \ (long)(void*)(lpint), \ - 0 ) - + 0 ) + #define ICCompressBegin(hic, lpbiInput, lpbiOutput) \ ICSendMessage( \ @@ -570,7 +570,7 @@ typedef struct AVIFILEINFOW { long dwSuggestedBufferSize; long dwWidth; long dwHeight; - long dwScale; + long dwScale; long dwRate; long dwLength; long dwEditCount; @@ -585,7 +585,7 @@ typedef struct AVIFILEINFOA { long dwSuggestedBufferSize; long dwWidth; long dwHeight; - long dwScale; + long dwScale; long dwRate; long dwLength; long dwEditCount; diff --git a/loader/wine/winbase.h b/loader/wine/winbase.h index 60664b1928..b7ae733553 100644 --- a/loader/wine/winbase.h +++ b/loader/wine/winbase.h @@ -321,9 +321,9 @@ typedef struct #define GETBASEIRQ 10 /* Purge functions for Comm Port */ -#define PURGE_TXABORT 0x0001 /* Kill the pending/current writes to the +#define PURGE_TXABORT 0x0001 /* Kill the pending/current writes to the comm port */ -#define PURGE_RXABORT 0x0002 /*Kill the pending/current reads to +#define PURGE_RXABORT 0x0002 /*Kill the pending/current reads to the comm port */ #define PURGE_TXCLEAR 0x0004 /* Kill the transmit queue if there*/ #define PURGE_RXCLEAR 0x0008 /* Kill the typeahead buffer if there*/ @@ -398,7 +398,7 @@ typedef struct #define RT_GROUP_ICON WINELIB_NAME_AW(RT_GROUP_ICON) -#define LMEM_FIXED 0 +#define LMEM_FIXED 0 #define LMEM_MOVEABLE 0x0002 #define LMEM_NOCOMPACT 0x0010 #define LMEM_NODISCARD 0x0020 @@ -833,10 +833,10 @@ typedef struct LDT_ENTRY { struct { BYTE BaseMid; BYTE Flags1;/*Declare as bytes to avoid alignment problems */ - BYTE Flags2; + BYTE Flags2; BYTE BaseHi; } Bytes; - struct { + struct { unsigned BaseMid : 8; unsigned Type : 5; unsigned Dpl : 2; @@ -877,7 +877,7 @@ typedef struct DllVersionInfo { * This one seems to be a Win32 only definition. It also is defined with * WINAPI instead of CALLBACK in the windows headers. */ -typedef DWORD WINAPI (*LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, +typedef DWORD WINAPI (*LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, DWORD, DWORD, HANDLE, HANDLE, LPVOID); @@ -1075,7 +1075,7 @@ typedef struct tagCOMMTIMEOUTS { DWORD WriteTotalTimeoutMultiplier; DWORD WriteTotalTimeoutConstant; } COMMTIMEOUTS,*LPCOMMTIMEOUTS; - + #include "poppack.h" typedef void CALLBACK (*PAPCFUNC)(ULONG_PTR); @@ -1095,7 +1095,7 @@ WIN_BOOL WINAPI SetCommState(INT,LPDCB); WIN_BOOL WINAPI TransmitCommChar(INT,CHAR); WIN_BOOL WINAPI SetupComm(HANDLE, DWORD, DWORD); WIN_BOOL WINAPI GetCommProperties(HANDLE, LPDCB *); - + /*DWORD WINAPI GetVersion( void );*/ WIN_BOOL16 WINAPI GetVersionEx16(OSVERSIONINFO16*); WIN_BOOL WINAPI GetVersionExA(OSVERSIONINFOA*); @@ -1116,7 +1116,7 @@ void WINAPI RaiseException(DWORD,DWORD,DWORD,const LPDWORD); WIN_BOOL WINAPI SetProcessWorkingSetSize(HANDLE,DWORD,DWORD); WIN_BOOL WINAPI TerminateProcess(HANDLE,DWORD); WIN_BOOL WINAPI TerminateThread(HANDLE,DWORD); -WIN_BOOL WINAPI GetExitCodeThread(HANDLE,LPDWORD); +WIN_BOOL WINAPI GetExitCodeThread(HANDLE,LPDWORD); /* GetBinaryType return values. */ @@ -1368,7 +1368,7 @@ WIN_BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPWSTR,LPDWORD,LPWSTR,LPDW #define LookupAccountSid WINELIB_NAME_AW(LookupAccountSidW) WIN_BOOL WINAPI LocalFileTimeToFileTime(const FILETIME*,LPFILETIME); WIN_BOOL WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD); -WIN_BOOL WINAPI LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED); +WIN_BOOL WINAPI LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED); WIN_BOOL WINAPI LookupPrivilegeValueA(LPCSTR,LPCSTR,LPVOID); WIN_BOOL WINAPI LookupPrivilegeValueW(LPCWSTR,LPCWSTR,LPVOID); #define LookupPrivilegeValue WINELIB_NAME_AW(LookupPrivilegeValue) diff --git a/loader/wine/windef.h b/loader/wine/windef.h index 9d90a42257..ddf0228dd0 100644 --- a/loader/wine/windef.h +++ b/loader/wine/windef.h @@ -91,7 +91,7 @@ extern "C" { #ifdef __i386__ # if defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) -# ifndef _EGCS_ +# ifndef _EGCS_ #define __stdcall __attribute__((__stdcall__)) #define __cdecl __attribute__((__cdecl__)) # define RESTORE_ES __asm__ volatile("pushl %ds\n\tpopl %es") @@ -99,7 +99,7 @@ extern "C" { # else // # error You need gcc >= 2.7 to build Wine on a 386 # endif -#else +#else # define __stdcall # define __cdecl # define RESTORE_ES @@ -360,7 +360,7 @@ typedef UINT16 *LPUINT16; typedef HANDLE16 a##16; \ typedef a##16 *P##a##16; \ typedef a##16 *NP##a##16; \ - typedef a##16 *LP##a##16 + typedef a##16 *LP##a##16 DECLARE_HANDLE16(HACMDRIVERID); DECLARE_HANDLE16(HACMDRIVER); @@ -500,15 +500,15 @@ typedef LRESULT CALLBACK (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM); /* Macros to access unaligned or wrong-endian WORDs and DWORDs. */ /* Note: These macros are semantically broken, at least for wrc. wrc - spits out data in the platform's current binary format, *not* in + spits out data in the platform's current binary format, *not* in little-endian format. These macros are used throughout the resource - code to load and store data to the resources. Since it is unlikely - that we'll ever be dealing with little-endian resource data, the - byte-swapping nature of these macros has been disabled. Rather than + code to load and store data to the resources. Since it is unlikely + that we'll ever be dealing with little-endian resource data, the + byte-swapping nature of these macros has been disabled. Rather than remove the use of these macros from the resource loading code, the - macros have simply been disabled. In the future, someone may want + macros have simply been disabled. In the future, someone may want to reactivate these macros for other purposes. In that case, the - resource code will have to be modified to use different macros. */ + resource code will have to be modified to use different macros. */ #if 1 #define PUT_WORD(ptr,w) (*(WORD *)(ptr) = (w)) @@ -619,7 +619,7 @@ typedef const RECT *LPCRECT; typedef struct tagRECTL { LONG left; - LONG top; + LONG top; LONG right; LONG bottom; } RECTL, *PRECTL, *LPRECTL; diff --git a/loader/wine/winnt.h b/loader/wine/winnt.h index dd0f0b05c5..b4c8ee1573 100644 --- a/loader/wine/winnt.h +++ b/loader/wine/winnt.h @@ -152,11 +152,11 @@ typedef struct FLOATING_SAVE_AREA { DWORD ControlWord; DWORD StatusWord; - DWORD TagWord; + DWORD TagWord; DWORD ErrorOffset; DWORD ErrorSelector; DWORD DataOffset; - DWORD DataSelector; + DWORD DataSelector; BYTE RegisterArea[SIZE_OF_80387_REGISTERS]; DWORD Cr0NpxState; } FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA; @@ -180,18 +180,18 @@ typedef struct CONTEXT86 DWORD SegGs; DWORD SegFs; DWORD SegEs; - DWORD SegDs; + DWORD SegDs; /* These are selected by CONTEXT_INTEGER */ DWORD Edi; DWORD Esi; DWORD Ebx; - DWORD Edx; + DWORD Edx; DWORD Ecx; DWORD Eax; /* These are selected by CONTEXT_CONTROL */ - DWORD Ebp; + DWORD Ebp; DWORD Eip; DWORD SegCs; DWORD EFlags; @@ -228,7 +228,7 @@ typedef CONTEXT86 CONTEXT; #if defined(_ALPHA_) || defined(__alpha__) #define CONTEXT_ALPHA 0x00020000 - + #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001L) #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L) #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L) @@ -543,10 +543,10 @@ typedef struct STACK_FRAME_HEADER #ifdef __sparc__ -/* - * FIXME: +/* + * FIXME: * - * There is no official CONTEXT structure defined for the SPARC + * There is no official CONTEXT structure defined for the SPARC * architecture, so I just made one up. * * This structure is valid only for 32-bit SPARC architectures, @@ -556,8 +556,8 @@ typedef struct STACK_FRAME_HEADER * the rest of the register window chain is not visible. * * The layout follows the Solaris 'prgregset_t' structure. - * - */ + * + */ #define CONTEXT_SPARC 0x10000000 @@ -663,7 +663,7 @@ typedef HANDLE *PHANDLE; #define CH_reg(context) (*((BYTE*)&ECX_reg(context)+1)) #define DL_reg(context) (*(BYTE*)&EDX_reg(context)) #define DH_reg(context) (*((BYTE*)&EDX_reg(context)+1)) - + #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001) #define RESET_CFLAG(context) (EFL_reg(context) &= ~0x0001) #define SET_ZFLAG(context) (EFL_reg(context) |= 0x0040) @@ -756,7 +756,7 @@ typedef HANDLE *PHANDLE; #ifdef __sparc__ # define GET_IP(context) ((LPVOID)(context)->pc) #endif - + #if !defined(GET_IP) && !defined(RC_INVOKED) # error You must define GET_IP for this CPU #endif @@ -772,7 +772,7 @@ typedef HANDLE *PHANDLE; #define STATUS_TIMEOUT 0x00000102 #define STATUS_PENDING 0x00000103 -#define STATUS_GUARD_PAGE_VIOLATION 0x80000001 +#define STATUS_GUARD_PAGE_VIOLATION 0x80000001 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002 #define STATUS_BREAKPOINT 0x80000003 #define STATUS_SINGLE_STEP 0x80000004 @@ -885,7 +885,7 @@ typedef HANDLE *PHANDLE; #define STATUS_FILE_LOCK_CONFLICT 0xC0000055 /* FIXME: not sure */ #define STATUS_UNKNOWN_REVISION 0xC0000058 #define STATUS_INVALID_SECURITY_DESCR 0xC0000079 -#define STATUS_DISK_FULL 0xC000007F +#define STATUS_DISK_FULL 0xC000007F #define STATUS_SECTION_NOT_EXTENDED 0xC0000087 #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C #define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D @@ -963,11 +963,11 @@ typedef HANDLE *PHANDLE; #define ExceptionContinueSearch 1 #define ExceptionNestedException 2 #define ExceptionCollidedUnwind 3 - + /* * Return values from filters in except() and from UnhandledExceptionFilter */ - + #define EXCEPTION_EXECUTE_HANDLER 1 #define EXCEPTION_CONTINUE_SEARCH 0 #define EXCEPTION_CONTINUE_EXECUTION -1 @@ -985,9 +985,9 @@ typedef HANDLE *PHANDLE; #define EXCEPTION_CONTINUABLE 0 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE - + /* - * The exception record used by Win32 to give additional information + * The exception record used by Win32 to give additional information * about exception to exception handlers. */ @@ -1008,7 +1008,7 @@ typedef struct EXCEPTION_RECORD * The exception pointers structure passed to exception filters * in except() and the UnhandledExceptionFilter(). */ - + typedef struct EXCEPTION_POINTERS { PEXCEPTION_RECORD ExceptionRecord; @@ -1017,8 +1017,8 @@ typedef struct EXCEPTION_POINTERS /* - * The exception frame, used for registering exception handlers - * Win32 cares only about this, but compilers generally emit + * The exception frame, used for registering exception handlers + * Win32 cares only about this, but compilers generally emit * larger exception frames for their own use. */ @@ -1120,7 +1120,7 @@ typedef struct IMAGE_DOS_HEADER { * This is the Windows executable (NE) header. * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way. */ -typedef struct +typedef struct { WORD ne_magic; /* 00 NE signature 'NE' */ BYTE ne_ver; /* 02 Linker version number */ @@ -1232,7 +1232,7 @@ typedef struct IMAGE_VXD_HEADER { #define IMAGE_FILE_MACHINE_R4000 0x166 #define IMAGE_FILE_MACHINE_R10000 0x168 #define IMAGE_FILE_MACHINE_ALPHA 0x184 -#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 +#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 #define IMAGE_SIZEOF_FILE_HEADER 20 @@ -1379,8 +1379,8 @@ typedef struct IMAGE_SECTION_HEADER { #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 -#define IMAGE_SCN_LNK_OTHER 0x00000100 -#define IMAGE_SCN_LNK_INFO 0x00000200 +#define IMAGE_SCN_LNK_OTHER 0x00000100 +#define IMAGE_SCN_LNK_INFO 0x00000200 /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */ #define IMAGE_SCN_LNK_REMOVE 0x00000800 #define IMAGE_SCN_LNK_COMDAT 0x00001000 @@ -1635,7 +1635,7 @@ typedef struct IMAGE_IMPORT_DESCRIPTOR { DWORD ForwarderChain; /* -1 if no forwarders */ DWORD Name; /* RVA to IAT (if bound this IAT has actual addresses) */ - PIMAGE_THUNK_DATA FirstThunk; + PIMAGE_THUNK_DATA FirstThunk; } IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR; #define IMAGE_ORDINAL_FLAG 0x80000000 @@ -2037,7 +2037,7 @@ typedef struct tagMESSAGE_RESOURCE_DATA { /* * Here follows typedefs for security and tokens. - */ + */ /* * First a constant for the following typdefs. @@ -2053,17 +2053,17 @@ typedef PVOID PACCESS_TOKEN; */ typedef enum TOKEN_INFORMATION_CLASS { - TokenUser = 1, - TokenGroups, - TokenPrivileges, - TokenOwner, - TokenPrimaryGroup, - TokenDefaultDacl, - TokenSource, - TokenType, - TokenImpersonationLevel, - TokenStatistics -} TOKEN_INFORMATION_CLASS; + TokenUser = 1, + TokenGroups, + TokenPrivileges, + TokenOwner, + TokenPrimaryGroup, + TokenDefaultDacl, + TokenSource, + TokenType, + TokenImpersonationLevel, + TokenStatistics +} TOKEN_INFORMATION_CLASS; #ifndef SECURITY_DEFINED #define SECURITY_DEFINED @@ -2101,8 +2101,8 @@ typedef struct SID { #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */ -/* - * ACL +/* + * ACL */ #define ACL_REVISION1 1 @@ -2158,7 +2158,7 @@ typedef struct { PACL Dacl; } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR; -#define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR)) +#define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR)) #include "poppack.h" @@ -2166,15 +2166,15 @@ typedef struct { #include "pshpack1.h" -/* +/* * SID_AND_ATTRIBUTES */ typedef struct SID_AND_ATTRIBUTES { - PSID Sid; - DWORD Attributes; -} SID_AND_ATTRIBUTES ; - + PSID Sid; + DWORD Attributes; +} SID_AND_ATTRIBUTES ; + /* security entities */ #define SECURITY_NULL_RID (0x00000000L) #define SECURITY_WORLD_RID (0x00000000L) @@ -2190,7 +2190,7 @@ typedef struct SID_AND_ATTRIBUTES { /* S-1-3 */ #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} -#define SECURITY_CREATOR_OWNER_RID (0x00000000L) +#define SECURITY_CREATOR_OWNER_RID (0x00000000L) #define SECURITY_CREATOR_GROUP_RID (0x00000001L) #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L) #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L) @@ -2199,7 +2199,7 @@ typedef struct SID_AND_ATTRIBUTES { #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} /* S-1-5 */ -#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} +#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} #define SECURITY_DIALUP_RID 0x00000001L #define SECURITY_NETWORK_RID 0x00000002L #define SECURITY_BATCH_RID 0x00000003L @@ -2234,17 +2234,17 @@ typedef struct SID_AND_ATTRIBUTES { */ typedef struct TOKEN_USER { - SID_AND_ATTRIBUTES User; -} TOKEN_USER; + SID_AND_ATTRIBUTES User; +} TOKEN_USER; /* * TOKEN_GROUPS */ typedef struct TOKEN_GROUPS { - DWORD GroupCount; - SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; -} TOKEN_GROUPS; + DWORD GroupCount; + SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; +} TOKEN_GROUPS; /* * LUID_AND_ATTRIBUTES @@ -2273,9 +2273,9 @@ typedef union ULARGE_INTEGER { typedef LARGE_INTEGER LUID,*PLUID; typedef struct LUID_AND_ATTRIBUTES { - LUID Luid; - DWORD Attributes; -} LUID_AND_ATTRIBUTES; + LUID Luid; + DWORD Attributes; +} LUID_AND_ATTRIBUTES; /* * PRIVILEGE_SET @@ -2292,25 +2292,25 @@ typedef struct PRIVILEGE_SET { */ typedef struct TOKEN_PRIVILEGES { - DWORD PrivilegeCount; - LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; -} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; + DWORD PrivilegeCount; + LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; +} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; /* * TOKEN_OWNER */ typedef struct TOKEN_OWNER { - PSID Owner; -} TOKEN_OWNER; + PSID Owner; +} TOKEN_OWNER; /* * TOKEN_PRIMARY_GROUP */ typedef struct TOKEN_PRIMARY_GROUP { - PSID PrimaryGroup; -} TOKEN_PRIMARY_GROUP; + PSID PrimaryGroup; +} TOKEN_PRIMARY_GROUP; /* @@ -2318,37 +2318,37 @@ typedef struct TOKEN_PRIMARY_GROUP { */ typedef struct TOKEN_DEFAULT_DACL { - PACL DefaultDacl; -} TOKEN_DEFAULT_DACL; + PACL DefaultDacl; +} TOKEN_DEFAULT_DACL; /* * TOKEN_SOURCEL */ typedef struct TOKEN_SOURCE { - char Sourcename[8]; - LUID SourceIdentifier; -} TOKEN_SOURCE; + char Sourcename[8]; + LUID SourceIdentifier; +} TOKEN_SOURCE; /* * TOKEN_TYPE */ typedef enum tagTOKEN_TYPE { - TokenPrimary = 1, - TokenImpersonation -} TOKEN_TYPE; + TokenPrimary = 1, + TokenImpersonation +} TOKEN_TYPE; /* * SECURITY_IMPERSONATION_LEVEL */ typedef enum SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous, - SecurityIdentification, - SecurityImpersonation, - SecurityDelegation -} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; + SecurityAnonymous, + SecurityIdentification, + SecurityImpersonation, + SecurityDelegation +} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, @@ -2369,20 +2369,20 @@ typedef struct SECURITY_QUALITY_OF_SERVICE { */ typedef struct TOKEN_STATISTICS { - LUID TokenId; - LUID AuthenticationId; - LARGE_INTEGER ExpirationTime; - TOKEN_TYPE TokenType; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - DWORD DynamicCharged; - DWORD DynamicAvailable; - DWORD GroupCount; - DWORD PrivilegeCount; - LUID ModifiedId; -} TOKEN_STATISTICS; - -/* - * ACLs of NT + LUID TokenId; + LUID AuthenticationId; + LARGE_INTEGER ExpirationTime; + TOKEN_TYPE TokenType; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + DWORD DynamicCharged; + DWORD DynamicAvailable; + DWORD GroupCount; + DWORD PrivilegeCount; + LUID ModifiedId; +} TOKEN_STATISTICS; + +/* + * ACLs of NT */ #define ACL_REVISION 2 @@ -2414,7 +2414,7 @@ typedef struct ACE_HEADER { #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40 #define FAILED_ACCESS_ACE_FLAG 0x80 -/* different ACEs depending on AceType +/* different ACEs depending on AceType * SidStart marks the begin of a SID * so the thing finally looks like this: * 0: ACE_HEADER @@ -2513,8 +2513,8 @@ typedef enum tagSID_NAME_USE { #define THREAD_DIRECT_IMPERSONATION 0x0200 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff) -#define THREAD_BASE_PRIORITY_LOWRT 15 -#define THREAD_BASE_PRIORITY_MAX 2 +#define THREAD_BASE_PRIORITY_LOWRT 15 +#define THREAD_BASE_PRIORITY_MAX 2 #define THREAD_BASE_PRIORITY_MIN -2 #define THREAD_BASE_PRIORITY_IDLE -15 diff --git a/loader/wine/winreg.h b/loader/wine/winreg.h index 31d36fcb10..ede64c0fd5 100644 --- a/loader/wine/winreg.h +++ b/loader/wine/winreg.h @@ -34,7 +34,7 @@ extern "C" { /* * registry provider structs */ -typedef struct value_entA +typedef struct value_entA { LPSTR ve_valuename; DWORD ve_valuelen; DWORD_PTR ve_valueptr; diff --git a/loader/wine/winuser.h b/loader/wine/winuser.h index f42fbd7bba..bf60f873f0 100644 --- a/loader/wine/winuser.h +++ b/loader/wine/winuser.h @@ -599,7 +599,7 @@ typedef struct #define WM_IME_COMPOSITION 0x010f #define WM_IME_KEYLAST 0x010f -#define WM_INITDIALOG 0x0110 +#define WM_INITDIALOG 0x0110 #define WM_COMMAND 0x0111 #define WM_SYSCOMMAND 0x0112 #define WM_TIMER 0x0113 @@ -644,7 +644,7 @@ typedef struct #define WM_MOUSELAST WM_MOUSEWHEEL - + #define WHEEL_DELTA 120 #define WHEEL_PAGESCROLL (UINT_MAX) #define WM_PARENTNOTIFY 0x0210 @@ -733,19 +733,19 @@ typedef struct #define WM_QUERYAFXWNDPROC 0x0360 #define WM_SIZEPARENT 0x0361 #define WM_SETMESSAGESTRING 0x0362 -#define WM_IDLEUPDATECMDUI 0x0363 +#define WM_IDLEUPDATECMDUI 0x0363 #define WM_INITIALUPDATE 0x0364 #define WM_COMMANDHELP 0x0365 #define WM_HELPHITTEST 0x0366 #define WM_EXITHELPMODE 0x0367 #define WM_RECALCPARENT 0x0368 #define WM_SIZECHILD 0x0369 -#define WM_KICKIDLE 0x036A +#define WM_KICKIDLE 0x036A #define WM_QUERYCENTERWND 0x036B #define WM_DISABLEMODAL 0x036C -#define WM_FLOATSTATUS 0x036D -#define WM_ACTIVATETOPLEVEL 0x036E -#define WM_QUERY3DCONTROLS 0x036F +#define WM_FLOATSTATUS 0x036D +#define WM_ACTIVATETOPLEVEL 0x036E +#define WM_QUERY3DCONTROLS 0x036F #define WM_SOCKET_NOTIFY 0x0373 #define WM_SOCKET_DEAD 0x0374 #define WM_POPMESSAGESTRING 0x0375 @@ -789,7 +789,7 @@ typedef struct #define IDYES 6 #define IDNO 7 #define IDCLOSE 8 -#define IDHELP 9 +#define IDHELP 9 /****** Window classes ******/ @@ -838,7 +838,7 @@ typedef struct BYTE rgbReserved[32]; } PAINTSTRUCT, *PPAINTSTRUCT, *LPPAINTSTRUCT; -typedef struct +typedef struct { HMENU hWindowMenu; UINT idFirstChild; @@ -874,7 +874,7 @@ typedef struct DECL_WINELIB_TYPE_AW(MDICREATESTRUCT) DECL_WINELIB_TYPE_AW(LPMDICREATESTRUCT) -#define MDITILE_VERTICAL 0x0000 +#define MDITILE_VERTICAL 0x0000 #define MDITILE_HORIZONTAL 0x0001 #define MDITILE_SKIPDISABLED 0x0002 @@ -1058,7 +1058,7 @@ typedef struct #define PRF_ERASEBKGND 0x00000008L #define PRF_CHILDREN 0x00000010L #define PRF_OWNED 0x00000020L - + /* Offsets for GetClassLong() and GetClassWord() */ #define GCL_MENUNAME (-8) #define GCW_HBRBACKGROUND (-10) @@ -1295,7 +1295,7 @@ typedef struct tagMSG #define POINTSTOPOINT(pt, pts) \ { (pt).x = (LONG)(SHORT)LOWORD(*(LONG*)&pts); \ - (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); } + (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); } #define POINTTOPOINTS(pt) (MAKELONG((short)((pt).x), (short)((pt).y))) @@ -1345,7 +1345,7 @@ typedef struct #define TPM_NONOTIFY 0x0080 #define TPM_RETURNCMD 0x0100 -typedef struct +typedef struct { UINT cbSize; RECT rcExclude; @@ -1518,7 +1518,7 @@ typedef WIN_BOOL CALLBACK (*DRAWSTATEPROC)(HDC,LPARAM,WPARAM,INT,INT); #define BST_CHECKED 0x0001 #define BST_INDETERMINATE 0x0002 #define BST_PUSHED 0x0004 -#define BST_FOCUS 0x0008 +#define BST_FOCUS 0x0008 /* Static Control Styles */ #define SS_LEFT 0x00000000L @@ -1578,8 +1578,8 @@ typedef struct INT nPos; INT nTrackPos; } SCROLLINFO, *LPSCROLLINFO; - -/* GetScrollInfo() flags */ + +/* GetScrollInfo() flags */ #define SIF_RANGE 0x0001 #define SIF_PAGE 0x0002 #define SIF_POS 0x0004 @@ -1781,7 +1781,7 @@ typedef struct #define HELPINFO_MENUITEM 0x0002 /* Structure pointed to by lParam of WM_HELP */ -typedef struct +typedef struct { UINT cbSize; /* Size in bytes of this struct */ INT iContextType; /* Either HELPINFO_WINDOW or HELPINFO_MENUITEM */ @@ -1843,28 +1843,28 @@ typedef struct numberfmt32w { } NUMBERFMTW; typedef struct currencyfmt32a -{ - UINT NumDigits; - UINT LeadingZero; - UINT Grouping; - LPCSTR lpDecimalSep; - LPCSTR lpThousandSep; - UINT NegativeOrder; - UINT PositiveOrder; +{ + UINT NumDigits; + UINT LeadingZero; + UINT Grouping; + LPCSTR lpDecimalSep; + LPCSTR lpThousandSep; + UINT NegativeOrder; + UINT PositiveOrder; LPCSTR lpCurrencySymbol; -} CURRENCYFMTA; +} CURRENCYFMTA; typedef struct currencyfmt32w -{ - UINT NumDigits; - UINT LeadingZero; - UINT Grouping; - LPCWSTR lpDecimalSep; - LPCWSTR lpThousandSep; - UINT NegativeOrder; - UINT PositiveOrder; +{ + UINT NumDigits; + UINT LeadingZero; + UINT Grouping; + LPCWSTR lpDecimalSep; + LPCWSTR lpThousandSep; + UINT NegativeOrder; + UINT PositiveOrder; LPCWSTR lpCurrencySymbol; -} CURRENCYFMTW; +} CURRENCYFMTW; #define MONITOR_DEFAULTTONULL 0x00000000 #define MONITOR_DEFAULTTOPRIMARY 0x00000001 @@ -2070,7 +2070,7 @@ typedef struct #define MNC_IGNORE 0 #define MNC_CLOSE 1 #define MNC_EXECUTE 2 -#define MNC_SELECT 3 +#define MNC_SELECT 3 /* SystemParametersInfo */ /* defines below are for all win versions */ @@ -2764,7 +2764,7 @@ typedef struct #define VK_NONAME 0xFC #define VK_PA1 0xFD #define VK_OEM_CLEAR 0xFE - + /* Key status flags for mouse events */ #define MK_LBUTTON 0x0001 #define MK_RBUTTON 0x0002 diff --git a/loader/wrapper.S b/loader/wrapper.S index fe2d85619b..7656a00f92 100644 --- a/loader/wrapper.S +++ b/loader/wrapper.S @@ -6,10 +6,10 @@ caller_return: report_entry: .long null_call .globl report_ret -report_ret: +report_ret: .long null_call .global wrapper_target -wrapper_target: +wrapper_target: .long null_call .section .text @@ -22,43 +22,43 @@ null_call: .type wrapper, @function .balign 16,0x90 wrapper: - pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) + pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) pushf # store flags - - push %ebp # set up a stack frame + + push %ebp # set up a stack frame movl %esp, %ebp leal 4(%ebp), %eax # push flags addr push %eax leal 8(%ebp), %eax # push registers addr push %eax - - leal 40(%ebp), %edx + + leal 40(%ebp), %edx movl (%ebp), %eax subl %edx, %eax push %eax push %edx - + call *report_entry # report entry - + test %eax, %eax jnz .Ldone leave # restore %esp, %ebp popf # restore flags popa # restore registers - + popl caller_return # switch return addresses - pushl $.Lwrapper_return - + pushl $.Lwrapper_return + jmp *wrapper_target # wrapper_target should return at .Lwrapper_return .balign 16, 0x90 -.Lwrapper_return: +.Lwrapper_return: pushl caller_return # restore the original return address pusha # more for reference sake here pushf - + push %ebp # set up a stack frame movl %esp, %ebp @@ -74,10 +74,10 @@ wrapper: push %edx call *report_ret # report the return information (same args) -.Ldone: +.Ldone: leave popf popa ret - + |