]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/SnpNt32Dxe/SnpNt32.c
EDK II Packages: Add Contributions.txt and License.txt files
[mirror_edk2.git] / Nt32Pkg / SnpNt32Dxe / SnpNt32.c
index d995a6eecec7c324c9567d94e37343a8dac9895c..86414696c418e88c5f9379f1a12948dbd61eca5b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -42,7 +42,7 @@ SNPNT32_GLOBAL_DATA         gSnpNt32GlobalData = {
   {\r
     0,\r
     0,\r
-    0\r
+    EfiLockUninitialized\r
   },                          //  Lock\r
   //\r
   //  Private functions\r
@@ -440,7 +440,7 @@ SNPNT32_INSTANCE_DATA gSnpNt32InstanceTemplate = {
     NET_IFTYPE_ETHERNET,                  //  IfType\r
     FALSE,                                //  MacAddressChangeable\r
     FALSE,                                //  MultipleTxSupported\r
-    FALSE,                                //  MediaPresentSupported\r
+    TRUE,                                 //  MediaPresentSupported\r
     TRUE                                  //  MediaPresent\r
   },\r
   {\r
@@ -995,6 +995,9 @@ SnpNt32Receive (
   SNPNT32_INSTANCE_DATA *Instance;\r
   SNPNT32_GLOBAL_DATA   *GlobalData;\r
   INT32                 ReturnValue;\r
+  UINTN                 BufSize;\r
+  \r
+  BufSize     = *BuffSize;\r
 \r
   Instance    = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);\r
 \r
@@ -1042,7 +1045,7 @@ SnpNt32Receive (
     *Protocol = NTOHS (*((UINT16 *) (((UINT8 *) Buffer) + 12)));\r
   }\r
 \r
-  return EFI_SUCCESS;\r
+  return (*BuffSize <= BufSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL; \r
 }\r
 \r
 /**\r
@@ -1083,7 +1086,7 @@ SnpNt32InitializeGlobalData (
   //\r
   //  Get the WinNT thunk\r
   //\r
-  Status = gBS->LocateProtocol (&gEfiWinNtThunkProtocolGuid, NULL, &This->WinNtThunk);\r
+  Status = gBS->LocateProtocol (&gEfiWinNtThunkProtocolGuid, NULL, (VOID **)&This->WinNtThunk);\r
 \r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -1284,7 +1287,7 @@ SnpNt32InitializeInstanceData (
   CopyMem (\r
     &Node.MacAddr.MacAddress,\r
     &Instance->Mode.CurrentAddress,\r
-    sizeof (EFI_MAC_ADDRESS)\r
+    NET_ETHER_ADDR_LEN\r
     );\r
 \r
   Node.MacAddr.IfType = Instance->Mode.IfType;\r
@@ -1409,7 +1412,7 @@ SnpNt32Unload (
 \r
 **/\r
 EFI_STATUS\r
-InitializeSnpNt32river (\r
+InitializeSnpNt32Driver (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r