Run-Time Check Failure #0 – The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

Before

typedef void  (*LPFN_GETLSPGUID) (LPGUID lpGuid);

Fix:

typedef void  (WINAPI *LPFN_GETLSPGUID) (LPGUID lpGuid);