[PATCH 3/4] Implement Windows version lookup
- From: Jens Georg <mail jensge org>
- To: gupnp-list gnome org
- Subject: [PATCH 3/4] Implement Windows version lookup
- Date: Sat, 18 Jun 2011 12:42:08 +0200
---
libgupnp/gupnp-context.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index 663928d..7b0dfa3 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -116,8 +116,17 @@ static char *
make_server_id (void)
{
#ifdef G_OS_WIN32
- return g_strdup_printf ("Microsoft Windows UPnP/1.0 GUPnP/%s",
- VERSION);
+ OSVERSIONINFO versioninfo;
+ versioninfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ if (GetVersionEx (&versioninfo)) {
+ return g_strdup_printf ("Microsoft Windows/%ld.%ld UPnP/1.0 GUPnP/%s",
+ versioninfo.dwMajorVersion,
+ versioninfo.dwMinorVersion,
+ VERSION);
+ } else {
+ return g_strdup_printf ("Microsoft Windows UPnP/1.0 GUPnP/%s",
+ VERSION);
+ }
#else
struct utsname sysinfo;
--
1.7.5.4
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]