ReactOS 0.4.16-dev-2104-gb84fa49
setid.c File Reference
#include "diskpart.h"
#include <debug.h>
Include dependency graph for setid.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

EXIT_CODE setid_main (_In_ INT argc, _In_ PWSTR *argv)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file setid.c.

Function Documentation

◆ setid_main()

EXIT_CODE setid_main ( _In_ INT  argc,
_In_ PWSTR argv 
)

Definition at line 16 of file setid.c.

19{
20 INT i, length;
21 PWSTR pszSuffix, pszId = NULL;
23
24 DPRINT("SetId()\n");
25
26 if (CurrentDisk == NULL)
27 {
29 return EXIT_SUCCESS;
30 }
31
33 {
35 return EXIT_SUCCESS;
36 }
37
38 for (i = 1; i < argc; i++)
39 {
40 if (_wcsicmp(argv[i], L"noerr") == 0)
41 {
42 /* noerr */
43 DPRINT("NOERR\n");
44 ConPuts(StdOut, L"The NOERR option is not supported yet!\n");
45 }
46 }
47
48 for (i = 1; i < argc; i++)
49 {
50 if (HasPrefix(argv[i], L"id=", &pszSuffix))
51 {
52 /* id=<Byte>|<GUID> */
53 DPRINT("ID : %s\n", pszSuffix);
54 pszId = pszSuffix;
55 }
56 else if (_wcsicmp(argv[i], L"noerr") == 0)
57 {
58 /* noerr - Already handled above */
59 }
60 else if (_wcsicmp(argv[i], L"override") == 0)
61 {
62 /* override */
63 DPRINT("OVERRIDE\n");
64 ConPuts(StdOut, L"The OVERRIDE option is not supported yet!\n");
65 }
66 else
67 {
69 return EXIT_SUCCESS;
70 }
71 }
72
74 {
76 {
78 return EXIT_SUCCESS;
79 }
80
84 if (!NT_SUCCESS(Status))
85 {
87 return EXIT_SUCCESS;
88 }
89 }
91 {
93
94 length = wcslen(pszId);
95 if (length == 0)
96 {
98 return EXIT_SUCCESS;
99 }
100
101 if (length > 2)
102 {
104 return EXIT_SUCCESS;
105 }
106
107 PartitionType = (UCHAR)wcstoul(pszSuffix, NULL, 16);
108 if ((PartitionType == 0) && (errno == ERANGE))
109 {
111 return EXIT_SUCCESS;
112 }
113
114 if (PartitionType == 0x42)
115 {
117 return EXIT_SUCCESS;
118 }
119
124 if (!NT_SUCCESS(Status))
125 {
127 return EXIT_SUCCESS;
128 }
129 }
130
132
133 return EXIT_SUCCESS;
134}
static int argc
Definition: ServiceArgs.c:12
void ConPuts(FILE *fp, LPCWSTR psz)
Definition: fc.c:16
#define StdOut
Definition: fc.c:14
#define StdErr
Definition: fc.c:15
void ConResPuts(FILE *fp, UINT nID)
Definition: fc.c:27
LONG NTSTATUS
Definition: precomp.h:26
#define IDS_SETID_INVALID_TYPE
Definition: resource.h:137
#define IDS_SETID_FAIL
Definition: resource.h:134
#define IDS_SELECT_NO_PARTITION
Definition: resource.h:126
#define IDS_SETID_SUCCESS
Definition: resource.h:135
#define IDS_ERROR_INVALID_ARGS
Definition: resource.h:229
#define IDS_SETID_INVALID_FORMAT
Definition: resource.h:136
#define IDS_SELECT_NO_DISK
Definition: resource.h:121
VOID UpdateMbrDiskLayout(_In_ PDISKENTRY DiskEntry)
Definition: partlist.c:2362
BOOL HasPrefix(_In_ PWSTR pszString, _In_ PWSTR pszPrefix, _Out_opt_ PWSTR *pszSuffix)
Definition: misc.c:58
VOID UpdateGptDiskLayout(_In_ PDISKENTRY DiskEntry, _In_ BOOL DeleteEntry)
Definition: partlist.c:2539
PDISKENTRY CurrentDisk
Definition: partlist.c:75
NTSTATUS WriteMbrPartitions(_In_ PDISKENTRY DiskEntry)
Definition: partlist.c:2034
NTSTATUS WriteGptPartitions(_In_ PDISKENTRY DiskEntry)
Definition: partlist.c:2158
BOOL StringToGUID(_Out_ GUID *pGuid, _In_ PWSTR pszString)
Definition: misc.c:227
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
_ACRTIMP __msvcrt_ulong __cdecl wcstoul(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2912
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:159
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
#define ERANGE
Definition: errno.h:55
#define errno
Definition: errno.h:120
#define L(x)
Definition: resources.c:13
Status
Definition: gdiplustypes.h:25
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ PARTITION_STYLE_GPT
Definition: imports.h:202
@ PARTITION_STYLE_MBR
Definition: imports.h:201
#define argv
Definition: mplay32.c:18
CHAR PartitionType
Definition: part_xbox.c:32
#define EXIT_SUCCESS
Definition: rdjpgcom.c:55
#define DPRINT
Definition: sndvol32.h:73
BOOLEAN Dirty
Definition: partlist.h:136
DWORD PartitionStyle
Definition: diskpart.h:219
MBR_PARTITION_DATA Mbr
Definition: diskpart.h:141
GPT_PARTITION_DATA Gpt
Definition: diskpart.h:142
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
static PPARTENTRY CurrentPartition
Definition: usetup.c:78
unsigned char UCHAR
Definition: xmlstorage.h:181