Author: dchapyshev
Date: Sun Jan 18 06:50:56 2009
New Revision: 38888
URL:
http://svn.reactos.org/svn/reactos?rev=38888&view=rev
Log:
- Implement pSetupGuidFromString
- Implement pSetupStringFromGuid
- Implement pSetupIsGuidNull
Modified:
trunk/reactos/dll/win32/setupapi/misc.c
trunk/reactos/dll/win32/setupapi/setupapi.spec
Modified: trunk/reactos/dll/win32/setupapi/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/misc.c?…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/misc.c [iso-8859-1] Sun Jan 18 06:50:56 2009
@@ -1595,3 +1595,93 @@
TRACE("%s -> %s %d\n", debugstr_w(source), debugstr_w(target), comp);
return ret;
}
+
+/*
+ * implemented (used by pSetupGuidFromString)
+ */
+static BOOL TrimGuidString(PCWSTR szString, LPWSTR szNewString)
+{
+ WCHAR szBuffer[39];
+ INT Index;
+
+ if (wcslen(szString) == 38)
+ {
+ if ((szString[0] == L'{') && (szString[37] == L'}'))
+ {
+ for (Index = 0; Index < wcslen(szString); Index++)
+ szBuffer[Index] = szString[Index + 1];
+
+ szBuffer[36] = L'\0';
+ wcscpy(szNewString, szBuffer);
+ return TRUE;
+ }
+ }
+ wcscpy(szNewString, L"\0");
+ return FALSE;
+}
+
+/*
+ * implemented
+ */
+DWORD
+WINAPI
+pSetupGuidFromString(PCWSTR pString, LPGUID lpGUID)
+{
+ RPC_STATUS Status;
+ WCHAR szBuffer[39];
+
+ if (!TrimGuidString(pString, szBuffer))
+ {
+ return RPC_S_INVALID_STRING_UUID;
+ }
+
+ Status = UuidFromStringW(szBuffer, lpGUID);
+ if (Status != RPC_S_OK)
+ {
+ return RPC_S_INVALID_STRING_UUID;
+ }
+
+ return NO_ERROR;
+}
+
+/*
+ * implemented
+ */
+DWORD
+WINAPI
+pSetupStringFromGuid(LPGUID lpGUID, PWSTR pString, DWORD dwStringLen)
+{
+ RPC_STATUS Status;
+ RPC_WSTR rpcBuffer;
+ WCHAR szBuffer[39];
+
+ if (dwStringLen < 39)
+ {
+ return ERROR_INSUFFICIENT_BUFFER;
+ }
+
+ Status = UuidToStringW(lpGUID, &rpcBuffer);
+ if (Status != RPC_S_OK)
+ {
+ return Status;
+ }
+
+ wcscpy(szBuffer, L"{");
+ wcscat(szBuffer, rpcBuffer);
+ wcscat(szBuffer, L"}\0");
+
+ wcscpy(pString, szBuffer);
+
+ RpcStringFreeW(&rpcBuffer);
+ return NO_ERROR;
+}
+
+/*
+ * implemented
+ */
+BOOL
+WINAPI
+pSetupIsGuidNull(LPGUID lpGUID)
+{
+ return IsEqualGUID(lpGUID, &GUID_NULL);
+}
Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sun Jan 18 06:50:56 2009
@@ -557,11 +557,11 @@
@ stub pSetupGetOsLoaderDriveAndPath
@ stdcall pSetupGetQueueFlags(ptr)
@ stub pSetupGetVersionDatum
-@ stub pSetupGuidFromString
-@ stub pSetupIsGuidNull
+@ stdcall pSetupGuidFromString(wstr ptr)
+@ stdcall pSetupIsGuidNull(ptr)
@ stub pSetupMakeSurePathExists
@ stdcall pSetupSetGlobalFlags(long)
@ stdcall pSetupSetQueueFlags(ptr long)
@ stub pSetupSetSystemSourceFlags
-@ stub pSetupStringFromGuid
+@ stdcall pSetupStringFromGuid(ptr wstr long)
@ stub pSetupVerifyQueuedCatalogs