[APPHELP] Fix warnings
authorMark Jansen <mark.jansen@reactos.org>
Thu, 18 Apr 2019 17:21:25 +0000 (19:21 +0200)
committerMark Jansen <mark.jansen@reactos.org>
Thu, 18 Apr 2019 17:21:39 +0000 (19:21 +0200)
dll/appcompat/apphelp/apphelp.c
dll/appcompat/apphelp/sdbapi.c
dll/appcompat/apphelp/sdbwrite.c

index e05c1fd..5df880c 100644 (file)
@@ -314,7 +314,7 @@ BOOL WINAPI SdbRegisterDatabaseEx(
             UNICODE_STRING DatabaseDescriptionKey = RTL_CONSTANT_STRING(L"DatabaseDescription");
 
             Status = NtSetValueKey(DbKey, &DatabasePathKey, 0, REG_SZ,
-                                   (PVOID)pszDatabasePath, (wcslen(pszDatabasePath) + 1) * sizeof(WCHAR));
+                                   (PVOID)pszDatabasePath, ((ULONG)wcslen(pszDatabasePath) + 1) * sizeof(WCHAR));
             if (!NT_SUCCESS(Status))
                 SHIM_ERR("Unable to write %wZ\n", &DatabasePathKey);
 
@@ -349,7 +349,7 @@ BOOL WINAPI SdbRegisterDatabaseEx(
             if (NT_SUCCESS(Status) && Information.Description)
             {
                 Status = NtSetValueKey(DbKey, &DatabaseDescriptionKey, 0, REG_SZ,
-                                       (PVOID)Information.Description, (wcslen(Information.Description) + 1) * sizeof(WCHAR));
+                                       (PVOID)Information.Description, ((ULONG)wcslen(Information.Description) + 1) * sizeof(WCHAR));
                 if (!NT_SUCCESS(Status))
                     SHIM_ERR("Unable to write %wZ\n", &DatabaseDescriptionKey);
             }
index 1a14424..5ddf989 100644 (file)
@@ -151,7 +151,7 @@ void WINAPI SdbpFlush(PDB pdb)
 
 DWORD SdbpStrlen(PCWSTR string)
 {
-    return wcslen(string);
+    return (DWORD)wcslen(string);
 }
 
 DWORD SdbpStrsize(PCWSTR string)
index 8602084..8f68e76 100644 (file)
@@ -111,12 +111,12 @@ PDB WINAPI SdbCreateDatabase(LPCWSTR path, PATH_TYPE type)
     if (!pdb)
         return NULL;
 
-    pdb->size = sizeof(DWORD) + sizeof(DWORD) + strlen(magic);
+    pdb->size = sizeof(DWORD) + sizeof(DWORD) + (DWORD)strlen(magic);
     pdb->data = SdbAlloc(pdb->size);
 
     SdbpWrite(pdb, &version_major, sizeof(DWORD));
     SdbpWrite(pdb, &version_minor, sizeof(DWORD));
-    SdbpWrite(pdb, magic, strlen(magic));
+    SdbpWrite(pdb, magic, (DWORD)strlen(magic));
 
     return pdb;
 }