ReactOS
0.4.16-dev-297-gc569aee
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
uniqueid.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS DiskPart
3
* LICENSE: GPL - See COPYING in the top level directory
4
* FILE: base/system/diskpart/uniqueid.c
5
* PURPOSE: Manages all the partitions of the OS in an interactive way.
6
* PROGRAMMERS: Lee Schroeder
7
*/
8
9
#include "
diskpart.h
"
10
11
#define NDEBUG
12
#include <debug.h>
13
14
/* FUNCTIONS ******************************************************************/
15
16
BOOL
17
UniqueIdDisk
(
18
_In_
INT
argc
,
19
_In_
PWSTR
*
argv
)
20
{
21
PWSTR
pszSuffix =
NULL
;
22
ULONG
ulValue;
23
24
if
(
CurrentDisk
==
NULL
)
25
{
26
ConResPuts
(
StdOut
,
IDS_SELECT_NO_DISK
);
27
return
TRUE
;
28
}
29
30
if
(
argc
== 2)
31
{
32
ConPuts
(
StdOut
,
L
"\n"
);
33
ConPrintf
(
StdOut
,
L
"Disk ID: %08lx\n"
,
CurrentDisk
->
LayoutBuffer
->
Signature
);
34
ConPuts
(
StdOut
,
L
"\n"
);
35
return
TRUE
;
36
}
37
38
if
(
argc
!= 3)
39
{
40
ConResPuts
(
StdErr
,
IDS_ERROR_INVALID_ARGS
);
41
return
TRUE
;
42
}
43
44
if
(!
HasPrefix
(
argv
[2],
L
"ID="
, &pszSuffix))
45
{
46
ConResPuts
(
StdErr
,
IDS_ERROR_INVALID_ARGS
);
47
return
TRUE
;
48
}
49
50
if
((pszSuffix ==
NULL
) ||
51
(
wcslen
(pszSuffix) != 8) ||
52
(
IsHexString
(pszSuffix) ==
FALSE
))
53
{
54
ConResPuts
(
StdErr
,
IDS_ERROR_INVALID_ARGS
);
55
return
TRUE
;
56
}
57
58
ulValue =
wcstoul
(pszSuffix,
NULL
, 16);
59
if
((ulValue == 0) && (
errno
==
ERANGE
))
60
{
61
ConResPuts
(
StdErr
,
IDS_ERROR_INVALID_ARGS
);
62
return
TRUE
;
63
}
64
65
DPRINT
(
"New Signature: 0x%08lx\n"
, ulValue);
66
CurrentDisk
->
LayoutBuffer
->
Signature
= ulValue;
67
CurrentDisk
->
Dirty
=
TRUE
;
68
UpdateDiskLayout
(
CurrentDisk
);
69
WritePartitions
(
CurrentDisk
);
70
71
return
TRUE
;
72
}
argc
static int argc
Definition:
ServiceArgs.c:12
ERANGE
#define ERANGE
Definition:
acclib.h:92
ConPuts
void ConPuts(FILE *fp, LPCWSTR psz)
Definition:
fc.c:16
ConPrintf
void ConPrintf(FILE *fp, LPCWSTR psz,...)
Definition:
fc.c:20
StdOut
#define StdOut
Definition:
fc.c:14
StdErr
#define StdErr
Definition:
fc.c:15
ConResPuts
void ConResPuts(FILE *fp, UINT nID)
Definition:
fc.c:27
IDS_ERROR_INVALID_ARGS
#define IDS_ERROR_INVALID_ARGS
Definition:
resource.h:187
IDS_SELECT_NO_DISK
#define IDS_SELECT_NO_DISK
Definition:
resource.h:85
UniqueIdDisk
BOOL UniqueIdDisk(_In_ INT argc, _In_ PWSTR *argv)
Definition:
uniqueid.c:17
diskpart.h
HasPrefix
BOOL HasPrefix(_In_ PWSTR pszString, _In_ PWSTR pszPrefix, _Out_opt_ PWSTR *pszSuffix)
Definition:
misc.c:58
CurrentDisk
PDISKENTRY CurrentDisk
Definition:
partlist.c:74
IsHexString
BOOL IsHexString(_In_ PWSTR pszHexString)
Definition:
misc.c:36
NULL
#define NULL
Definition:
types.h:112
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
wcstoul
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
wcslen
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
argv
#define argv
Definition:
mplay32.c:18
_In_
#define _In_
Definition:
no_sal2.h:158
L
#define L(x)
Definition:
ntvdm.h:50
errno
#define errno
Definition:
errno.h:18
UpdateDiskLayout
static VOID UpdateDiskLayout(IN PDISKENTRY DiskEntry)
Definition:
partlist.c:2585
WritePartitions
NTSTATUS WritePartitions(IN PDISKENTRY DiskEntry)
Definition:
partlist.c:3582
DPRINT
#define DPRINT
Definition:
sndvol32.h:73
_DISKENTRY::Dirty
BOOLEAN Dirty
Definition:
partlist.h:136
_DISKENTRY::LayoutBuffer
PDRIVE_LAYOUT_INFORMATION LayoutBuffer
Definition:
partlist.h:143
_DRIVE_LAYOUT_INFORMATION::Signature
ULONG Signature
Definition:
ntdddisk.h:420
PWSTR
uint16_t * PWSTR
Definition:
typedefs.h:56
INT
int32_t INT
Definition:
typedefs.h:58
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
base
system
diskpart
uniqueid.c
Generated on Tue Nov 26 2024 06:06:01 for ReactOS by
1.9.6