]>
git.proxmox.com Git - mirror_edk2.git/blob - StdLib/EfiSocketLib/Init.c
2 Implement the constructor and destructor for the EFI socket library
4 Copyright (c) 2011, Intel Corporation. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
13 EFI Socket Library Constructor
15 This routine supports an implementation dependent constructor
16 depending upon whether the library is linked to a socket
17 application or the SocketDxe driver. The following modules
18 declare the redirection for the constructor in ::mpfnEslConstructor:
20 <li>StdLib/EfiSocketLib/UseSocketLib.c - Application links against EfiSocketLib</li>
21 <li>StdLib/SocketDxe/EntryUnload.c - SocketDxe links against EfiSocketLib</li>
24 The EfiSocketLib.inf file lists ::EslConstructor as the CONSTRUCTOR
25 in the [Defines] section. As a result, this routine is called by
26 the ProcessLibraryConstructorList routine of the AutoGen.c module
27 in the Build directory associated with the socket application or
30 @retval EFI_SUCCESS The socket layer initialization was successful
49 // Call the image dependent constructor if available
51 if ( NULL
!= mpfnEslConstructor
) {
52 Status
= mpfnEslConstructor ( );
56 // Return the constructor status
58 DBG_EXIT_STATUS ( Status
);
64 EFI Socket Library Destructor
66 This routine supports an implementation dependent destructor
67 depending upon whether the library is linked to a socket
68 application or the SocketDxe driver. The following modules
69 declare the redirection for the destructor in ::mpfnEslDestructor:
71 <li>StdLib/EfiSocketLib/UseSocketLib.c - Application links against EfiSocketLib</li>
72 <li>StdLib/SocketDxe/EntryUnload.c - SocketDxe links against EfiSocketLib</li>
75 The EfiSocketLib.inf file lists ::EslDestructor as the DESTRUCTOR
76 in the [Defines] section. As a result, this routine is called by
77 the ProcessLibraryDestructorList routine of the AutoGen.c module
78 in the Build directory associated with the socket application or
81 @retval EFI_SUCCESS The socket layer shutdown was successful
100 // Call the image dependent destructor if available
102 if ( NULL
!= mpfnEslDestructor
) {
103 Status
= mpfnEslDestructor ( );
107 // Return the constructor status
109 DBG_EXIT_STATUS ( Status
);