]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/commitdiff
Fix/suppress prefast warnings
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 15 Aug 2014 10:14:37 +0000 (11:14 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Fri, 15 Aug 2014 13:41:54 +0000 (14:41 +0100)
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/win32stubagent/WmiAccessor.cpp
src/win32stubagent/XService.cpp
src/xeniface/wmi.c

index d585e7751e414c2f502ee7e140d8ef08380efbfa..288b801bf0dee1aedd3fb70c0eef0e1cc70cdeba 100644 (file)
@@ -242,7 +242,7 @@ static string wstring2string(const wstring& wstr)
                               wstr.c_str(),
                               -1,
                               &str[0],
-                              str.length(),
+                              (int)str.length(),
                               NULL,
                               NULL);
 
@@ -609,13 +609,13 @@ QueryVariant(WMIAccessor *wmi, PWCHAR field, PWCHAR table, VARIANT *vt)
 {
     IEnumWbemClassObject *pEnum;
     BSTR query;
-    unsigned query_len;
+    size_t query_len;
     IWbemClassObject *pclsObj;
     HRESULT hr;
     ULONG uReturn;
 
     query_len = strlen("SELECT  FROM ") + wcslen(field) + wcslen(table) + 1;
-    query = SysAllocStringLen(NULL, query_len);
+    query = SysAllocStringLen(NULL, (UINT)query_len);
     if (query == NULL) {
         hr = E_OUTOFMEMORY;
         goto err;
@@ -868,9 +868,9 @@ IWbemClassObject *openSession(WMIAccessor** wmi, const char *sessionname)
     if (FAILED(outMethodInst->Get(L"SessionId", 0, &var, NULL, NULL)))
         goto outmethodgetfailed;
 
-    ULONG query_len;
+    size_t query_len;
     query_len = strlen("SELECT * FROM CitrixXenStoreSession WHERE SessionId=")+10;
-    query = SysAllocStringLen(NULL, query_len);
+    query = SysAllocStringLen(NULL, (UINT)query_len);
 
     if (query == NULL)
         goto allocqueryfailed;
@@ -1160,7 +1160,6 @@ sessionstart:
     OutputDebugString(__FUNCTION__ " SessionStartFailed");
     VariantClear(&vpath);
 
-sessionExec:
     OutputDebugString(__FUNCTION__ " SessionExecFailed");
 setvpath:
     OutputDebugString(__FUNCTION__ " SetVpathFailed");
index dd41ca435c780aa6f47bb5f655c559fa41263a59..1fbb1383241a79e71466944642e14a1b22ad209f 100644 (file)
@@ -681,7 +681,9 @@ static bool hosttimeIsUTC()
         utc=true;
     }
 
+#ifdef _WIN64
 done:
+#endif 
     RegCloseKey(InstallRegKey);
     return utc;
 
index 5d7bce77e12e96b3daa170cdefb3dd817664e5a3..91aa2e996f81533adedd2c5bc725c68424a6ba61 100644 (file)
@@ -55,14 +55,15 @@ void LockSessions(
     ExAcquireFastMutex(&fdoData->SessionLock);
 }
 
+
 __drv_requiresIRQL(APC_LEVEL)
 __drv_restoresIRQLGlobal(OldIrql, fdoData->SessionLock)
 void UnlockSessions(
         XENIFACE_FDO* fdoData)
 {
     ASSERT(KeGetCurrentIrql() == APC_LEVEL);
+#pragma prefast (suppress:26110)
     ExReleaseFastMutex(&fdoData->SessionLock);
-    
 }
 
 void GetUnicodeString(UNICODE_STRING *unicode, USHORT maxlength, LPWSTR location)
@@ -1528,6 +1529,7 @@ SessionExecuteRemoveWatch(UCHAR *InBuffer,
     else {
         XenIfaceDebugPrint(WARNING, "No Watch\n"); 
     }
+#pragma prefast (suppress:26110)
     ExReleaseFastMutex(&session->WatchMapLock);
     UnlockSessions(fdoData);