dmloader: Build with msvcrt.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-03 10:29:43 +02:00
parent d96fd000d3
commit a420853848
5 changed files with 28 additions and 29 deletions

View File

@ -1,6 +1,8 @@
MODULE = dmloader.dll MODULE = dmloader.dll
IMPORTS = dxguid uuid ole32 advapi32 IMPORTS = dxguid uuid ole32 advapi32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
container.c \ container.c \
debug.c \ debug.c \

View File

@ -172,7 +172,7 @@ static HRESULT WINAPI IDirectMusicContainerImpl_EnumObject(IDirectMusicContainer
HRESULT result = S_OK; HRESULT result = S_OK;
if (pwszAlias) { if (pwszAlias) {
lstrcpynW (pwszAlias, pContainedObject->wszAlias, DMUS_MAX_FILENAME); lstrcpynW (pwszAlias, pContainedObject->wszAlias, DMUS_MAX_FILENAME);
if (strlenW (pContainedObject->wszAlias) > DMUS_MAX_FILENAME) if (lstrlenW (pContainedObject->wszAlias) > DMUS_MAX_FILENAME)
result = DMUS_S_STRING_TRUNCATED; result = DMUS_S_STRING_TRUNCATED;
} }
*pDesc = pContainedObject->Desc; *pDesc = pContainedObject->Desc;

View File

@ -17,8 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include "dmloader_private.h" #include "dmloader_private.h"

View File

@ -34,7 +34,6 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/list.h" #include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h" #include "winreg.h"
#include "objbase.h" #include "objbase.h"

View File

@ -98,9 +98,9 @@ static HRESULT DMUSIC_CopyDescriptor(DMUS_OBJECTDESC *pDst, DMUS_OBJECTDESC *pSr
if (pSrc->dwValidData & DMUS_OBJ_OBJECT) pDst->guidObject = pSrc->guidObject; if (pSrc->dwValidData & DMUS_OBJ_OBJECT) pDst->guidObject = pSrc->guidObject;
if (pSrc->dwValidData & DMUS_OBJ_DATE) pDst->ftDate = pSrc->ftDate; if (pSrc->dwValidData & DMUS_OBJ_DATE) pDst->ftDate = pSrc->ftDate;
if (pSrc->dwValidData & DMUS_OBJ_VERSION) pDst->vVersion = pSrc->vVersion; if (pSrc->dwValidData & DMUS_OBJ_VERSION) pDst->vVersion = pSrc->vVersion;
if (pSrc->dwValidData & DMUS_OBJ_NAME) strcpyW (pDst->wszName, pSrc->wszName); if (pSrc->dwValidData & DMUS_OBJ_NAME) lstrcpyW (pDst->wszName, pSrc->wszName);
if (pSrc->dwValidData & DMUS_OBJ_CATEGORY) strcpyW (pDst->wszCategory, pSrc->wszCategory); if (pSrc->dwValidData & DMUS_OBJ_CATEGORY) lstrcpyW (pDst->wszCategory, pSrc->wszCategory);
if (pSrc->dwValidData & DMUS_OBJ_FILENAME) strcpyW (pDst->wszFileName, pSrc->wszFileName); if (pSrc->dwValidData & DMUS_OBJ_FILENAME) lstrcpyW (pDst->wszFileName, pSrc->wszFileName);
if (pSrc->dwValidData & DMUS_OBJ_STREAM) IStream_Clone (pSrc->pStream, &pDst->pStream); if (pSrc->dwValidData & DMUS_OBJ_STREAM) IStream_Clone (pSrc->pStream, &pDst->pStream);
if (pSrc->dwValidData & DMUS_OBJ_MEMORY) { if (pSrc->dwValidData & DMUS_OBJ_MEMORY) {
pDst->pbMemData = pSrc->pbMemData; pDst->pbMemData = pSrc->pbMemData;
@ -211,7 +211,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
} }
else if ((pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && else if ((pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
(pExistingEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && (pExistingEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
!strncmpW (pDesc->wszFileName, pExistingEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { !wcsncmp (pDesc->wszFileName, pExistingEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) {
TRACE(": found it by fullpath filename\n"); TRACE(": found it by fullpath filename\n");
if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) {
TRACE(": already loaded\n"); TRACE(": already loaded\n");
@ -223,8 +223,8 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
} }
else if ((pDesc->dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && else if ((pDesc->dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) &&
(pExistingEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && (pExistingEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) &&
!strncmpW (pDesc->wszName, pExistingEntry->Desc.wszName, DMUS_MAX_NAME) && !wcsncmp (pDesc->wszName, pExistingEntry->Desc.wszName, DMUS_MAX_NAME) &&
!strncmpW (pDesc->wszCategory, pExistingEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) { !wcsncmp (pDesc->wszCategory, pExistingEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) {
TRACE(": found it by name and category\n"); TRACE(": found it by name and category\n");
if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) {
TRACE(": already loaded\n"); TRACE(": already loaded\n");
@ -236,7 +236,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
} }
else if ((pDesc->dwValidData & DMUS_OBJ_NAME) && else if ((pDesc->dwValidData & DMUS_OBJ_NAME) &&
(pExistingEntry->Desc.dwValidData & DMUS_OBJ_NAME) && (pExistingEntry->Desc.dwValidData & DMUS_OBJ_NAME) &&
!strncmpW (pDesc->wszName, pExistingEntry->Desc.wszName, DMUS_MAX_NAME)) { !wcsncmp (pDesc->wszName, pExistingEntry->Desc.wszName, DMUS_MAX_NAME)) {
TRACE(": found it by name\n"); TRACE(": found it by name\n");
if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) {
TRACE(": already loaded\n"); TRACE(": already loaded\n");
@ -248,7 +248,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
} }
else if ((pDesc->dwValidData & DMUS_OBJ_FILENAME) && else if ((pDesc->dwValidData & DMUS_OBJ_FILENAME) &&
(pExistingEntry->Desc.dwValidData & DMUS_OBJ_FILENAME) && (pExistingEntry->Desc.dwValidData & DMUS_OBJ_FILENAME) &&
!strncmpW (pDesc->wszFileName, pExistingEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { !wcsncmp (pDesc->wszFileName, pExistingEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) {
TRACE(": found it by filename\n"); TRACE(": found it by filename\n");
if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) {
TRACE(": already loaded\n"); TRACE(": already loaded\n");
@ -291,7 +291,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
get_search_path(This, &pDesc->guidClass, wszFileName); get_search_path(This, &pDesc->guidClass, wszFileName);
p = wszFileName + lstrlenW(wszFileName); p = wszFileName + lstrlenW(wszFileName);
if (p > wszFileName && p[-1] != '\\') *p++ = '\\'; if (p > wszFileName && p[-1] != '\\') *p++ = '\\';
strcpyW(p, pDesc->wszFileName); lstrcpyW(p, pDesc->wszFileName);
} }
TRACE(": loading from file (%s)\n", debugstr_w(wszFileName)); TRACE(": loading from file (%s)\n", debugstr_w(wszFileName));
/* create stream and associate it with file */ /* create stream and associate it with file */
@ -368,7 +368,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
/* set filename (if we loaded via filename) */ /* set filename (if we loaded via filename) */
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) { if (pDesc->dwValidData & DMUS_OBJ_FILENAME) {
GotDesc.dwValidData |= (pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)); GotDesc.dwValidData |= (pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH));
strcpyW (GotDesc.wszFileName, pDesc->wszFileName); lstrcpyW (GotDesc.wszFileName, pDesc->wszFileName);
} }
if (FAILED(result)) { if (FAILED(result)) {
ERR(": failed to get descriptor\n"); ERR(": failed to get descriptor\n");
@ -433,7 +433,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetObject(IDirectMusicLoader8 *ifac
get_search_path(This, &pDesc->guidClass, wszFileName); get_search_path(This, &pDesc->guidClass, wszFileName);
p = wszFileName + lstrlenW(wszFileName); p = wszFileName + lstrlenW(wszFileName);
if (p > wszFileName && p[-1] != '\\') *p++ = '\\'; if (p > wszFileName && p[-1] != '\\') *p++ = '\\';
strcpyW(p, pDesc->wszFileName); lstrcpyW(p, pDesc->wszFileName);
} }
/* create stream */ /* create stream */
hr = DMUSIC_CreateDirectMusicLoaderFileStream ((LPVOID*)&pStream); hr = DMUSIC_CreateDirectMusicLoaderFileStream ((LPVOID*)&pStream);
@ -561,7 +561,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory(IDirectMusicLoad
if (!This->search_paths[index]) if (!This->search_paths[index])
This->search_paths[index] = HeapAlloc(GetProcessHeap(), 0, MAX_PATH); This->search_paths[index] = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
else if (!strncmpW(This->search_paths[index], path, MAX_PATH)) else if (!wcsncmp(This->search_paths[index], path, MAX_PATH))
return S_FALSE; return S_FALSE;
lstrcpynW(This->search_paths[index], path, MAX_PATH); lstrcpynW(This->search_paths[index], path, MAX_PATH);
@ -594,8 +594,8 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ScanDirectory(IDirectMusicLoader8 *
p = wszSearchString + lstrlenW(wszSearchString); p = wszSearchString + lstrlenW(wszSearchString);
if (p > wszSearchString && p[-1] != '\\') *p++ = '\\'; if (p > wszSearchString && p[-1] != '\\') *p++ = '\\';
*p++ = '*'; /* any file */ *p++ = '*'; /* any file */
if (strcmpW (pwzFileExtension, wszAny)) *p++ = '.'; /* if we have actual extension, put a dot */ if (lstrcmpW (pwzFileExtension, wszAny)) *p++ = '.'; /* if we have actual extension, put a dot */
strcpyW (p, pwzFileExtension); lstrcpyW (p, pwzFileExtension);
TRACE(": search string: %s\n", debugstr_w(wszSearchString)); TRACE(": search string: %s\n", debugstr_w(wszSearchString));
@ -610,7 +610,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ScanDirectory(IDirectMusicLoader8 *
DM_STRUCT_INIT(&Desc); DM_STRUCT_INIT(&Desc);
Desc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH | DMUS_OBJ_DATE; Desc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH | DMUS_OBJ_DATE;
Desc.guidClass = *rguidClass; Desc.guidClass = *rguidClass;
strcpyW (Desc.wszFileName, FileData.cFileName); lstrcpyW (Desc.wszFileName, FileData.cFileName);
FileTimeToLocalFileTime (&FileData.ftCreationTime, &Desc.ftDate); FileTimeToLocalFileTime (&FileData.ftCreationTime, &Desc.ftDate);
IDirectMusicLoader8_SetObject (iface, &Desc); IDirectMusicLoader8_SetObject (iface, &Desc);
@ -656,7 +656,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if
} }
else if ((Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && else if ((Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
(pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
!strncmpW (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { !wcsncmp (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) {
TRACE(": found it by fullpath filename\n"); TRACE(": found it by fullpath filename\n");
if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject)
result = S_FALSE; result = S_FALSE;
@ -666,8 +666,8 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if
} }
else if ((Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && else if ((Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) &&
(pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) &&
!strncmpW (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME) && !wcsncmp (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME) &&
!strncmpW (Desc.wszCategory, pObjectEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) { !wcsncmp (Desc.wszCategory, pObjectEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) {
TRACE(": found it by name and category\n"); TRACE(": found it by name and category\n");
if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject)
result = S_FALSE; result = S_FALSE;
@ -677,7 +677,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if
} }
else if ((Desc.dwValidData & DMUS_OBJ_NAME) && else if ((Desc.dwValidData & DMUS_OBJ_NAME) &&
(pObjectEntry->Desc.dwValidData & DMUS_OBJ_NAME) && (pObjectEntry->Desc.dwValidData & DMUS_OBJ_NAME) &&
!strncmpW (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME)) { !wcsncmp (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME)) {
TRACE(": found it by name\n"); TRACE(": found it by name\n");
if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject)
result = S_FALSE; result = S_FALSE;
@ -687,7 +687,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if
} }
else if ((Desc.dwValidData & DMUS_OBJ_FILENAME) && else if ((Desc.dwValidData & DMUS_OBJ_FILENAME) &&
(pObjectEntry->Desc.dwValidData & DMUS_OBJ_FILENAME) && (pObjectEntry->Desc.dwValidData & DMUS_OBJ_FILENAME) &&
!strncmpW (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { !wcsncmp (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) {
TRACE(": found it by filename\n"); TRACE(": found it by filename\n");
if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject)
result = S_FALSE; result = S_FALSE;
@ -736,29 +736,29 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 *
} }
else if ((Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && else if ((Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
(pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH | DMUS_OBJ_LOADED)) && (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH | DMUS_OBJ_LOADED)) &&
!strncmpW (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { !wcsncmp (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) {
TRACE(": found it by fullpath filename\n"); TRACE(": found it by fullpath filename\n");
result = S_OK; result = S_OK;
break; break;
} }
else if ((Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && else if ((Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) &&
(pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY | DMUS_OBJ_LOADED)) && (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY | DMUS_OBJ_LOADED)) &&
!strncmpW (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME) && !wcsncmp (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME) &&
!strncmpW (Desc.wszCategory, pObjectEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) { !wcsncmp (Desc.wszCategory, pObjectEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) {
TRACE(": found it by name and category\n"); TRACE(": found it by name and category\n");
result = S_OK; result = S_OK;
break; break;
} }
else if ((Desc.dwValidData & DMUS_OBJ_NAME) && else if ((Desc.dwValidData & DMUS_OBJ_NAME) &&
(pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_LOADED)) && (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_LOADED)) &&
!strncmpW (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME)) { !wcsncmp (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME)) {
TRACE(": found it by name\n"); TRACE(": found it by name\n");
result = S_OK; result = S_OK;
break; break;
} }
else if ((Desc.dwValidData & DMUS_OBJ_FILENAME) && else if ((Desc.dwValidData & DMUS_OBJ_FILENAME) &&
(pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_LOADED)) && (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_LOADED)) &&
!strncmpW (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { !wcsncmp (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) {
TRACE(": found it by filename\n"); TRACE(": found it by filename\n");
result = S_OK; result = S_OK;
break; break;