--- /dev/null
+# Makefile for use with NMAKE
+
+# Base path of MSVC installation
+VC_PATH=c:\Program Files\Microsoft SDKs\Windows\v6.0\VC
+
+# Base path of Windows SDK installation
+SDK_PATH=c:\Program Files\Microsoft SDKs\Windows\v6.0
+
+CL=$(VC_PATH)\bin\cl.exe
+LINK=$(VC_PATH)\bin\link.exe
+
+all: msvc-example.exe
+
+msvc-example.obj: msvc-example.c
+ "$(CL)" msvc-example.c -c -I..\..\libmoonshot -I"$(VC_PATH)\INCLUDE" -F$@
+
+msvc-example.exe: msvc-example.obj
+ "$(LINK)" msvc-example.obj ..\..\libmoonshot\libmoonshot.lib -LIBPATH:"$(VC_PATH)\LIB" -LIBPATH:"$(SDK_PATH)\LIB" -OUT:$@
--- /dev/null
+msvc-example: demonstrates using libmoonshot-0.dll from Visual C
+
+You must edit the Makefile to set up the correct paths before this
+example will build.
+
+To run it, you must set the correct PATH for the required DLL's:
+libmoonshot-0.dll (which is in ../../libmoonshot/.libs/) and msrpc-mingw.dll
+(which is in [msrpc-mingw tree]/build/). You will need to execute something
+like the following:
+
+ (in sh.exe:)
+
+PATH=../../libmoonshot/.libs:/c/build/src/msrpc-mingw/build/:$PATH msvc-example
+
+ (or in cmd.exe:)
+
+PATH=..\..\libmoonshot\.libs;c:\build\src\msrpc-mingw\build\;%PATH% msvc-example
--- /dev/null
+#include "libmoonshot.h"
+
+#include <stdio.h>
+
+int main (int argc, char *argv[])
+{
+ MoonshotError *error = NULL;
+ int success;
+
+ char *nai,
+ *password,
+ *server_certificate_hash,
+ *ca_certificate,
+ *subject_name_constraint,
+ *subject_alt_name_constraint;
+
+ success = moonshot_get_default_identity (&nai,
+ &password,
+ &server_certificate_hash,
+ &ca_certificate,
+ &subject_name_constraint,
+ &subject_alt_name_constraint,
+ &error);
+
+ if (success) {
+ printf ("Got identity: %s %s\n", nai, password);
+
+ moonshot_free (nai);
+ moonshot_free (password);
+ moonshot_free (server_certificate_hash);
+ moonshot_free (ca_certificate);
+ moonshot_free (subject_name_constraint);
+ moonshot_free (subject_alt_name_constraint);
+
+ return 0;
+ }
+
+ printf ("FAIL: %s\n", error->message);
+ return 1;
+}