mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 16:45:50 +00:00
- Start rosapps rearrange and cleanup process.
svn path=/trunk/; revision=34303
This commit is contained in:
parent
0a0a13a41c
commit
2012315e5a
1206 changed files with 81 additions and 81 deletions
84
rosapps/applications/devutils/genguid/genguid.c
Normal file
84
rosapps/applications/devutils/genguid/genguid.c
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* genguid utility for WINE and ReactOS
|
||||
*
|
||||
* Copyright 2003 Jonathan Wilson
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <objbase.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
GUID m_guid;
|
||||
m_guid = GUID_NULL;
|
||||
int arg;
|
||||
HRESULT result;
|
||||
char *strfmt = "";
|
||||
if (argc < 2) {
|
||||
printf("usage: %s n\n",argv[0]);
|
||||
printf("n = format of output\n");
|
||||
printf("values are:\n");
|
||||
printf("1 = IMPLEMENT_OLECREATE defintion\n");
|
||||
printf("2 = DEFINE_GUID definition\n");
|
||||
printf("3 = static const GUID definition\n");
|
||||
printf("4 = registry format\n");
|
||||
printf("5 = uuidgen.exe format\n");
|
||||
return 1;
|
||||
}
|
||||
arg = atoi(argv[1]);
|
||||
if ((arg > 5) || (arg <= 0)) {
|
||||
printf("invalid argument\n");
|
||||
return 1;
|
||||
}
|
||||
if (CoInitialize(NULL) != S_OK)
|
||||
{
|
||||
printf("Unable to initalize OLE libraries\n");
|
||||
return 1;
|
||||
}
|
||||
result = CoCreateGuid(&m_guid);
|
||||
if (result != S_OK) {
|
||||
printf("Unable to create GUID\n");
|
||||
CoUninitialize();
|
||||
return 1;
|
||||
}
|
||||
switch (arg) {
|
||||
case 1:
|
||||
strfmt = "// {%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}\r\nIMPLEMENT_OLECREATE(<<class>>, <<external_name>>, \r\n0x%lx, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\r\n";
|
||||
break;
|
||||
case 2:
|
||||
strfmt = "// {%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}\r\nDEFINE_GUID(<<name>>, \r\n0x%lx, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\r\n";
|
||||
break;
|
||||
case 3:
|
||||
strfmt = "// {%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}\r\nstatic const GUID <<name>> = \r\n{ 0x%lx, 0x%x, 0x%x, { 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x } };\r\n";
|
||||
break;
|
||||
case 4:
|
||||
strfmt = "{%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}\r\n";
|
||||
break;
|
||||
case 5:
|
||||
strfmt = "%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X\r\n";
|
||||
break;
|
||||
}
|
||||
printf(strfmt,m_guid.Data1,m_guid.Data2,m_guid.Data3,m_guid.Data4[0],
|
||||
m_guid.Data4[1],m_guid.Data4[2],m_guid.Data4[3],m_guid.Data4[4],m_guid.Data4[5],
|
||||
m_guid.Data4[6],m_guid.Data4[7],m_guid.Data1,m_guid.Data2,m_guid.Data3,m_guid.Data4[0],
|
||||
m_guid.Data4[1],m_guid.Data4[2],m_guid.Data4[3],m_guid.Data4[4],m_guid.Data4[5],
|
||||
m_guid.Data4[6],m_guid.Data4[7]);
|
||||
CoUninitialize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
9
rosapps/applications/devutils/genguid/genguid.rbuild
Normal file
9
rosapps/applications/devutils/genguid/genguid.rbuild
Normal file
|
@ -0,0 +1,9 @@
|
|||
<module name="genguid" type="win32cui" installbase="system32" installname="genguid.exe">
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<library>ole32</library>
|
||||
<library>uuid</library>
|
||||
<file>genguid.c</file>
|
||||
</module>
|
6
rosapps/applications/devutils/genguid/genguid.rc
Normal file
6
rosapps/applications/devutils/genguid/genguid.rc
Normal file
|
@ -0,0 +1,6 @@
|
|||
/* $Id$ */
|
||||
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "GUID Generator\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "genguid\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "genguid.exe\0"
|
||||
#include <reactos/version.rc>
|
Loading…
Add table
Add a link
Reference in a new issue