update for HEAD-2003091401
[reactos.git] / ntoskrnl / ldr / resource.c
index 2107463..9cfac25 100644 (file)
@@ -16,6 +16,9 @@
 
 /* FUNCTIONS ****************************************************************/
 
+/*
+ * @implemented
+ */
 NTSTATUS STDCALL
 LdrAccessResource(IN  PVOID BaseAddress,
                   IN  PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry,
@@ -30,6 +33,9 @@ LdrAccessResource(IN  PVOID BaseAddress,
    ULONG Offset = 0;
    ULONG Data;
 
+   if(!ResourceDataEntry)
+        return STATUS_RESOURCE_DATA_NOT_FOUND;
+
    Data = (ULONG)RtlImageDirectoryEntryToData (BaseAddress,
                                               TRUE,
                                               IMAGE_DIRECTORY_ENTRY_RESOURCE,
@@ -70,6 +76,9 @@ LdrAccessResource(IN  PVOID BaseAddress,
 }
 
 
+/*
+ * @implemented
+ */
 NTSTATUS STDCALL
 LdrFindResource_U(PVOID BaseAddress,
                   PLDR_RESOURCE_INFO ResourceInfo,
@@ -120,7 +129,7 @@ LdrFindResource_U(PVOID BaseAddress,
                    {
                       ws = (PWCHAR)((ULONG)ResDir + (ResEntry->Name & 0x7FFFFFFF));
                       if (!wcsncmp((PWCHAR)Id, ws + 1, *ws ) &&
-                          wcslen((PWCHAR)Id) == (int)*ws )
+                          wcslen((PWCHAR)Id) == (ULONG)*ws )
                         {
                            goto found;
                         }