An application is required to perform a successful
ImapInitialize call before it can call any of the other
library functions. When it has completed the use of library, the
application must call ImapUninitialize to allow the library
to free any resources allocated on behalf of the process. Any
pending blocking or asynchronous calls in this process are canceled
without posting any notification messages, and all sockets that
were opened by the process are closed.
There must be a call to ImapUninitialize for every
successful call to ImapInitialize made by a process. In a
multithreaded environment, operations for all threads in the client
are terminated.