source: trunk/src/kernel32/stubs.cpp@ 9975

Last change on this file since 9975 was 9975, checked in by sandervl, 22 years ago

YD: Changes for header updates

File size: 63.5 KB
Line 
1/* $Id: stubs.cpp,v 1.39 2003-04-02 12:58:31 sandervl Exp $
2 *
3 * Win32 KERNEL32 Subsystem for OS/2
4 *
5 * 1998/05/19 PH Patrick Haller (haller@zebra.fh-weingarten.de)
6 *
7 * @(#) Stubs.H 1.0.0 1998/05/19 PH start
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12
13/*****************************************************************************
14 * Includes *
15 *****************************************************************************/
16#include <os2win.h>
17#include <winnls.h>
18#include "unicode.h"
19#include "handlemanager.h"
20#include <string.h>
21
22#include "stubs.h"
23
24#define DBG_LOCALLOG DBG_stubs
25#include "dbglocal.h"
26
27
28/*****************************************************************************
29 * Defines *
30 *****************************************************************************/
31
32
33// For Backup functions
34
35//
36// Stream Ids
37//
38
39#define BACKUP_INVALID 0x00000000
40#define BACKUP_DATA 0x00000001
41#define BACKUP_EA_DATA 0x00000002
42#define BACKUP_SECURITY_DATA 0x00000003
43#define BACKUP_ALTERNATE_DATA 0x00000004
44#define BACKUP_LINK 0x00000005
45#define BACKUP_PROPERTY_DATA 0x00000006
46
47//
48// Stream Attributes
49//
50
51#define STREAM_NORMAL_ATTRIBUTE 0x00000000
52#define STREAM_MODIFIED_WHEN_READ 0x00000001
53#define STREAM_CONTAINS_SECURITY 0x00000002
54#define STREAM_CONTAINS_PROPERTIES 0x00000004
55
56
57// Locale
58#define LCID DWORD
59
60/*
61 * Locale Dependent Mapping Flags.
62 */
63
64#define LCMAP_LOWERCASE 0x00000100 /* lower case letters */
65#define LCMAP_UPPERCASE 0x00000200 /* upper case letters */
66#define LCMAP_SORTKEY 0x00000400 /* WC sort key (normalize) */
67#define LCMAP_BYTEREV 0x00000800 /* byte reversal */
68
69#define LCMAP_HIRAGANA 0x00100000 /* map katakana to hiragana */
70#define LCMAP_KATAKANA 0x00200000 /* map hiragana to katakana */
71#define LCMAP_HALFWIDTH 0x00400000 /* map double byte to single byte */
72#define LCMAP_FULLWIDTH 0x00800000 /* map single byte to double byte */
73
74#define LCMAP_LINGUISTIC_CASING 0x01000000 /* use linguistic rules for casing */
75
76#define LCMAP_SIMPLIFIED_CHINESE 0x02000000 /* map traditional chinese to simplified chinese */
77#define LCMAP_TRADITIONAL_CHINESE 0x04000000 /* map simplified chinese to traditional chinese */
78
79
80
81/*
82 * Locale Enumeration Flags.
83 */
84#define LCID_INSTALLED 0x00000001 /* installed locale ids */
85#define LCID_SUPPORTED 0x00000002 /* supported locale ids */
86
87
88
89
90/*****************************************************************************
91 * Structures *
92 *****************************************************************************/
93
94 // For Backup funtions
95
96typedef struct _WIN32_STREAM_ID {
97
98 DWORD dwStreamId;
99 DWORD dwStreamAttributes;
100 LARGE_INTEGER Size;
101 DWORD dwStreamNameSize;
102// WCHAR cStreamName[ ] ; /* @@@PH */
103 WCHAR cStreamName[1] ;
104} WIN32_STREAM_ID;
105
106
107//
108// File structures
109//
110
111//typedef struct _OVERLAPPED {
112// DWORD Internal;
113// DWORD InternalHigh;
114// DWORD Offset;
115// DWORD OffsetHigh;
116// HANDLE hEvent;
117//} OVERLAPPED, *LPOVERLAPPED;
118
119//typedef struct _SECURITY_ATTRIBUTES {
120// DWORD nLength;
121// LPVOID lpSecurityDescriptor;
122// BOOL bInheritHandle;
123//} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
124
125//typedef struct _PROCESS_INFORMATION {
126// HANDLE hProcess;
127// HANDLE hThread;
128// DWORD dwProcessId;
129// DWORD dwThreadId;
130//} PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
131
132// For Fiber functions
133
134typedef VOID (WINAPI *PFIBER_START_ROUTINE)(
135 LPVOID lpFiberParameter
136 );
137typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
138
139// For Enum CalendarInfo & EnumSystemCodePages see winnls.h
140
141/*
142 * Calendar type constant.
143 */
144typedef DWORD CALTYPE;
145
146/*
147 * Calendar ID.
148 */
149typedef DWORD CALID;
150
151
152/*****************************************************************************
153 * Prototypes *
154 *****************************************************************************/
155
156void WIN32API CommonUnimpStub()
157{
158 dprintf(("STUB: KERNEL32.17!!"));
159}
160
161/*****************************************************************************
162 * Name : BOOL WIN32API AreFileApisANSI (VOID)
163 * Purpose : The AreFileApisANSI function determines whether a set of Win32
164 * file functions is using the ANSI or OEM character set code page.
165 * This function is useful for 8-bit console input and output
166 * operations.
167 * Parameters: NONE
168 * Variables :
169 * Result : If the set of Win32 file functions is using the ANSI code page,
170 * the return value is nonzero.
171 * If the set of Win32 file functions is using the OEM code page,
172 * the return value is zero.
173 * Remark :
174 * Status : UNTESTED STUB
175 *
176 * Author : Markus Montkowski [Thu, 1998/02/19 11:46]
177 *****************************************************************************/
178
179BOOL WIN32API AreFileApisANSI (VOID)
180{
181
182 dprintf(("KERNEL32:AreFileApisANSI() not implemented - TRUE\n"
183 ));
184
185 return (TRUE);
186}
187
188/*****************************************************************************
189 * Name : BOOL WIN32API BackupRead(
190 * Purpose : The BackupRead function reads data associated with a specified
191 * file or directory into a buffer. You use this function to back
192 * up a file or directory.
193 * Parameters: HANDLE hFile handle to file or directory
194 * LPBYTE lpBuffer pointer to buffer to read to
195 * DWORD nNumberOfBytesToRead number of bytes to read
196 * LPDWORD lpNumberOfBytesRead pointer to variable to receive
197 * number of bytes read
198 * BOOL bAbort termination type
199 * BOOL bProcessSecurity process security flag
200 * LPVOID *lpContext pointer to pointer to internal
201 * context information
202 * Variables :
203 * Result : 0 on Error Nonzero if OK
204 * Remark : BackupRead processes all of the data pertaining to an opened
205 * object as a series of discrete byte streams. Each stream is
206 * preceded by a 32-bit aligned WIN32_STREAM_ID structure.
207 * Streams must be processed in the same order in which they were
208 * written to the tape. This ordering enables applications to
209 * compare the data backed up against the data on the source device.
210 * The data returned by BackupRead is to be used only as input to
211 * the BackupWrite function. This data is returned as one large data
212 * stream divided into substreams. The substreams are separated
213 * by WIN32_STREAM_ID headers.
214 *
215 * If an error occurs while BackupRead is reading, the calling
216 * process can skip the bad data by calling the BackupSeek function.
217 * Status : UNTESTED STUB
218 *
219 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
220 *****************************************************************************/
221
222BOOL WIN32API BackupRead(
223 HANDLE hFile, // handle to file or directory
224 LPBYTE lpBuffer, // pointer to buffer to read to
225 DWORD nNumberOfBytesToRead, // number of bytes to read
226 LPDWORD lpNumberOfBytesRead, // pointer to variable to receive number of bytes read
227 BOOL bAbort, // termination type
228 BOOL bProcessSecurity, // process security flag
229 LPVOID *lpContext // pointer to pointer to internal context information
230)
231{
232
233 dprintf(("KERNEL32:BackupRead(%08x,%08x,%08x,%08x,%08x,%08x,%08x) not implemented\n",
234 hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead,
235 bAbort, bProcessSecurity, lpContext
236 ));
237
238 return (FALSE);
239}
240/*****************************************************************************
241 * Name : BOOL WIN32API BackupSeek()
242 * Purpose : The BackupSeek function seeks forward in a data stream initially
243 * accessed by using the BackupRead or BackupWrite function.
244 * Parameters: HANDLE hFile handle to open file
245 * DWORD dwLowBytesToSeek low-order 32 bits of number of bytes
246 * DWORD dwHighBytesToSeek high-order 32 bits of number of bytes
247 * LPDWORD lpdwLowByteSeeked pointer to number of bytes function seeks
248 * LPDWORD lpdwHighByteSeeked pointer to number of bytes function seeks
249 * LPVOID *lpContext pointer to internal context information
250 *
251 * Variables :
252 * Result : If the function could seek the requested amount, the function
253 * returns nonzero.
254 * If the function could not seek the requested amount, the function
255 * returns zero.
256 * Remark : Applications use the BackUpSeek function to skip portions of a
257 * data stream that cause errors. This function does not seek across
258 * stream headers. If an application attempts to seek past the end
259 * of a substream, the function fails, the lpdwLowByteSeeked and
260 * lpdwHighByteSeeked parameters indicate the actual number of bytes
261 * the function seeks, and the file position is placed at the start
262 * of the next stream header.
263 * Status : UNTESTED STUB
264 *
265 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
266 *****************************************************************************/
267
268BOOL WIN32API BackupSeek( HANDLE hFile, DWORD dwLowBytesToSeek,
269 DWORD dwHighBytesToSeek,
270 LPDWORD lpdwLowByteSeeked,
271 LPDWORD lpdwHighByteSeeked,LPVOID *lpContext)
272{
273
274 dprintf(("KERNEL32:BackupSeek(%08x,%08x,%08x,%08x,%08x,08x) not implemented\n",
275 hFile, dwLowBytesToSeek,dwHighBytesToSeek,
276 lpdwLowByteSeeked, lpdwHighByteSeeked, lpContext));
277
278 return (FALSE);
279}
280
281/*****************************************************************************
282 * Name : BOOL WIN32API BackupWrite
283 * Purpose : The BackupWrite function writes a stream of data from a buffer to
284 * a specified file or directory. The data must be divided into
285 * substreams separated by WIN32_STREAM_ID structures. You use this
286 * function to restore a file or directory that has been backed up.
287 * Parameters: HANDLE hFile handle to file or directory
288 * LPBYTE lpBuffer pointer to buffer containing data
289 * to write
290 * DWORD nNumberOfBytesToWrite number of bytes to write
291 * LPDWORD lpNumberOfBytesWritten pointer to variable to receive
292 * number of bytes written
293 * BOOL bAbort termination type
294 * BOOL bProcessSecurity process security
295 * LPVOID *lpContext pointer to pointer to internal
296 * context information
297 *
298 * Variables :
299 * Result : If the function succeeds, the return value is nonzero.
300 * If the function fails, the return value is zero,
301 * indicating that an I/O error occurred.
302 * To get extended error information, call GetLastError.
303 * Remark :
304 * Status : UNTESTED STUB
305 *
306 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
307 *****************************************************************************/
308
309BOOL WIN32API BackupWrite( HANDLE hFile, LPBYTE lpBuffer,
310 DWORD nNumberOfBytesToWrite,
311 LPDWORD lpNumberOfBytesWritten,
312 BOOL bAbort, BOOL bProcessSecurity,
313 LPVOID *lpContext)
314{
315
316 dprintf(("KERNEL32:BackupWrite(%08x,%0x8,%08x,%08x,%08x,%08x,%08x) not implemented\n",
317 hFile, lpBuffer, nNumberOfBytesToWrite,
318 lpNumberOfBytesWritten, bAbort, bProcessSecurity, lpContext));
319
320 return (FALSE);
321}
322
323/*****************************************************************************
324 * Name : HANDLE WIN32API BeginUpdateResourceA
325 * Purpose : The BeginUpdateResource function returns a handle that can be
326 * used by the UpdateResource function to add, delete, or replace
327 * resources in an executable file.
328 * Parameters: LPCSTR pFileName pointer to file in which to
329 * update resources
330 * BOOL bDeleteExistingResources deletion option
331 *
332 * Variables :
333 * Result : If the function succeeds, the return value is a handle that can
334 * be used by the UpdateResource and EndUpdateResource functions.
335 * The return value is NULL if the specified file is not an
336 * executable file, the executable file is already loaded,
337 * the file does not exist, or the file cannot be opened for writing.
338 * To get extended error information, call GetLastError
339 * Remark :
340 * Status : UNTESTED STUB
341 *
342 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
343 *****************************************************************************/
344
345HANDLE WIN32API BeginUpdateResourceA( LPCSTR pFileName,
346 BOOL bDeleteExistingResources)
347{
348
349 dprintf(("KERNEL32: BeginUpdateResource(%08x,%08x) not implemented\n",
350 pFileName, bDeleteExistingResources
351 ));
352
353 return (NULL);
354}
355
356/*****************************************************************************
357 * Name : HANDLE WIN32API BeginUpdateResourceW
358 * Purpose : The BeginUpdateResource function returns a handle that can be
359 * used by the UpdateResource function to add, delete, or replace
360 * resources in an executable file.
361 * Parameters: LPCWSTR pFileName pointer to file in which to
362 * update resources
363 * BOOL bDeleteExistingResources deletion option
364 *
365 * Variables :
366 * Result : If the function succeeds, the return value is a handle that can
367 * be used by the UpdateResource and EndUpdateResource functions.
368 * The return value is NULL if the specified file is not an
369 * executable file, the executable file is already loaded,
370 * the file does not exist, or the file cannot be opened for writing.
371 * To get extended error information, call GetLastError
372 * Remark :
373 * Status : UNTESTED STUB
374 *
375 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
376 *****************************************************************************/
377
378HANDLE WIN32API BeginUpdateResourceW( LPCWSTR pFileName,
379 BOOL bDeleteExistingResources)
380{
381
382 dprintf(("KERNEL32: BeginUpdateResource(%08x,%08x) not implemented\n",
383 pFileName, bDeleteExistingResources
384 ));
385
386 return (NULL);
387}
388
389/*****************************************************************************
390 * Name : BOOL CancelWaitableTimer
391 * Purpose : The CancelWaitableTimer function sets the specified "waitable"
392 * timer to the inactive state.
393 * Parameters: HANDLE hTimer handle to a timer object
394 * Variables :
395 * Result : If the function succeeds, the return value is nonzero.
396 * If the function fails, the return value is zero.
397 * To get extended error information, call GetLastError.
398 * Remark : The CancelWaitableTimer function does not change the signaled
399 * state of the timer. It stops the timer before it can be set to
400 * the signaled state. Therefore, threads performing a wait
401 * operation on the timer remain waiting until they time out or
402 * the timer is reactivated and its state is set to signaled.
403 *
404 * To reactivate the timer, call the SetWaitableTimer function.
405 * Status : UNTESTED STUB
406 *
407 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
408 *****************************************************************************/
409
410BOOL WIN32API CancelWaitableTimer(HANDLE hTimer)
411{
412
413 dprintf(("KERNEL32:CancelWaitableTimer(%08x) not implemented\n",
414 hTimer
415 ));
416
417 return (FALSE);
418}
419
420
421/*****************************************************************************
422 * Name : LPVOID WIN32API CreateFiber
423 * Purpose : The CreateFiber function allocates a fiber object, assigns it a
424 * stack, and sets up execution to begin at the specified
425 * start address, typically the fiber function.
426 * This function does not schedule the fiber.
427 * Parameters: DWORD dwStackSize initial thread stack size, in bytes
428 * LPFIBER_START_ROUTINE lpStartAddress pointer to fiber function
429 * LPVOID lpParameter argument for new fiber
430 * Variables :
431 * Result : If the function succeeds, the return value is the address of
432 * the fiber.
433 * If the function fails, the return value is NULL.
434 * Remark : Before a thread can schedule a fiber using the SwitchToFiber
435 * function, it must call the ConvertThreadToFiber function so there
436 * is a fiber associated with the thread.
437 * The fiber function is of type FIBER_START_ROUTINE.
438 * It accepts a single value of type PVOID (fiber data) and does not
439 * return a value. The prototype for this function is as follows:
440 *
441 * VOID WINAPI FiberFunc( PVOID lpParameter );
442 *
443 * Status : UNTESTED STUB
444 *
445 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
446 *****************************************************************************/
447
448LPVOID WIN32API CreateFiber( DWORD dwStackSize,
449 LPFIBER_START_ROUTINE lpStartAddress,
450 LPVOID lpParameter)
451{
452
453 dprintf(("KERNEL32:CreateFiber(%08x,%08x,%08x) not implemented\n",
454 dwStackSize, lpStartAddress,lpParameter
455 ));
456
457 return (NULL);
458}
459
460
461/*****************************************************************************
462 * Name : HANDLE WIN32API CreateIoCompletionPort
463 * Purpose : The CreateIoCompletionPort function can associate an instance of
464 * an opened file with a newly created or an existing input/output
465 * completion port; or it can create an input/output completion port
466 * without associating it with a file.
467 * Associating an instance of an opened file with an input/output
468 * completion port lets an application receive notification of the
469 * completion of asynchronous input/output operations involving that
470 * file.
471 * Parameters: HANDLE FileHandle file handle to associate with I/O
472 * completion port. Must be created
473 * with flag FILE_FLAG_OVERLAPPED !
474 * HANDLE ExistingCompletionPort optional handle to existing
475 * I/O completion port
476 * DWORD CompletionKey per-file completion key for
477 * I/O completion packets
478 * DWORD NumberOfConcurrentThreads number of threads allowed to
479 * execute concurrently
480 * Variables :
481 * Result : If the function succeeds, the return value is the handle to the
482 * I/O completion port that is associated with the specified file.
483 * This return value is not NULL.
484 * If the function fails, the return value is NULL.
485 * Remark : The Win32 I/O system can be instructed to send I/O completion
486 * notification packets to input/output completion ports, where they
487 * are queued up. The CreateIoCompletionPort function provides a
488 * mechanism for this.
489 * When you perform an input/output operation with a file handle
490 * that has an associated input/output completion port, the
491 * I/O system sends a completion notification packet to the
492 * completion port when the I/O operation completes.
493 * The I/O completion port places the completion packet in a
494 * first-in-first-out queue.
495 * Use the GetQueuedCompletionStatus function to retrieve these
496 * queued I/O completion packets.
497 * Threads in the same process can use the PostQueuedCompletionStatus
498 * function to place I/O completion notification packets in a
499 * completion port's queue. This allows you to use the port to
500 * receive communications from other threads of the process,
501 * in addition to receiving I/O completion notification packets
502 * from the Win32 I/O system.
503 * Status : UNTESTED STUB
504 *
505 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
506 *****************************************************************************/
507
508HANDLE WIN32API CreateIoCompletionPort( HANDLE FileHandle,
509 HANDLE ExistingCompletionPort,
510 DWORD CompletionKey,
511 DWORD NumberOfConcurrentThreads)
512{
513
514 dprintf(("KERNEL32: CreateIoCompletionPort(%08x,%08x,%08x,%08x) not implemented\n",
515 FileHandle, ExistingCompletionPort, CompletionKey,
516 NumberOfConcurrentThreads
517 ));
518
519 return (NULL);
520}
521
522/*****************************************************************************
523 * Name : HANDLE WIN32API CreateRemoteThread
524 * Purpose : The CreateRemoteThread function creates a thread that runs in
525 * the address space of another process.
526 * Parameters: HANDLE hProcess handle to process to create thread in
527 * LPSECURITY_ATTRIBUTES lpThreadAttributes pointer to thread
528 * security attributes
529 * DWORD dwStackSize initial thread stack size, in bytes
530 * LPTHREAD_START_ROUTINE lpStartAddress pointer to thread function
531 * LPVOID lpParameter pointer to argument for new thread
532 * DWORD dwCreationFlags creation flags
533 * LPDWORD lpThreadId pointer to returned thread identifier
534 * Variables :
535 * Result : If the function succeeds, the return value is a handle to
536 * the new thread.
537 * If the function fails, the return value is NULL.
538 * Remark :
539 * Status : UNTESTED STUB
540 *
541 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
542 *****************************************************************************/
543
544HANDLE WIN32API CreateRemoteThread( HANDLE hProcess,
545 LPSECURITY_ATTRIBUTES lpThreadAttributes,
546 DWORD dwStackSize,
547 LPTHREAD_START_ROUTINE lpStartAddress,
548 LPVOID lpParameter,DWORD dwCreationFlags,
549 LPDWORD lpThreadId )
550{
551
552 dprintf(("KERNEL32: CreateRemoteThread(%08x,%08x,%08x,%08x,%08x,%08x,%08x) not implemented\n",
553 hProcess, lpThreadAttributes, dwStackSize, lpStartAddress,
554 lpParameter, dwCreationFlags, lpThreadId
555 ));
556
557 return (NULL);
558}
559/*****************************************************************************
560 * Name : DWORD WIN32API CreateTapePartition
561 * Purpose : The CreateTapePartition function reformats a tape.
562 * Parameters: HANDLE hDevice handle to open device
563 * DWORD dwPartitionMethode type of new partition
564 * DWORD dwCount number of new partitions to create
565 * DWORD dwSize size of new partition, in megabytes
566 * Variables :
567 * Result : If the function succeeds, the return value is NO_ERROR.
568 * If the function fails, it may return one of the following
569 * error codes:
570 * Error Description
571 * ERROR_BEGINNING_OF_MEDIA An attempt to access data before
572 * the beginning-of-medium marker failed.
573 * ERROR_BUS_RESET A reset condition was detected on the bus.
574 * ERROR_END_OF_MEDIA The end-of-tape marker was reached
575 * during an operation.
576 * ERROR_FILEMARK_DETECTED A filemark was reached during an operation.
577 * ERROR_SETMARK_DETECTED A setmark was reached during an operation.
578 * ERROR_NO_DATA_DETECTED The end-of-data marker was reached
579 * during an operation.
580 * ERROR_PARTITION_FAILURE The tape could not be partitioned.
581 * ERROR_INVALID_BLOCK_LENGTH The block size is incorrect on a
582 * new tape in a multivolume partition.
583 * ERROR_DEVICE_NOT_PARTITIONED The partition information could not
584 * be found when a tape was being loaded.
585 * ERROR_MEDIA_CHANGED The tape that was in the drive has
586 * been replaced or removed.
587 * ERROR_NO_MEDIA_IN_DRIVE There is no media in the drive.
588 * ERROR_NOT_SUPPORTED The tape driver does not support a
589 * requested function.
590 * ERROR_UNABLE_TO_LOCK_MEDIA An attempt to lock the ejection
591 * mechanism failed.
592 * ERROR_UNABLE_TO_UNLOAD_MEDIA An attempt to unload the tape failed.
593 * ERROR_WRITE_PROTECT The media is write protected.
594 * Remark : Creating partitions reformats the tape. All previous information
595 * recorded on the tape is destroyed.
596 * Errorcodes are defined in winerror.h
597 * Status : UNTESTED STUB
598 *
599 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
600 *****************************************************************************/
601
602DWORD WIN32API CreateTapePartition( HANDLE hDevice, DWORD dwPartitionMethod,
603 DWORD dwCount, DWORD dwSize)
604{
605
606 dprintf(("KERNEL32: CreateTapePartition(%08x,%08x,%08x,%08x) not implemented - ERROR_NOT_SUPPORTED\n",
607 hDevice, dwPartitionMethod, dwCount, dwSize
608 ));
609
610 return (ERROR_NOT_SUPPORTED);
611}
612/*****************************************************************************
613 * Name : HANDLE WIN23API CreateWaitableTimerA
614 * Purpose : The CreateWaitableTimerA function creates a "waitable" timer object.
615 * Parameters: LPSECURITY_ATTRIBUTES lpTimerAttributes pointer to security attributes
616 * BOOL bManualReset flag for manual reset state
617 * LPCTSTR lpTimerName pointer to timer object name
618 * Variables :
619 * Result : If the function succeeds, the return value is a handle to the
620 * timer object. If the named timer object exists before the
621 * function call, GetLastError returns ERROR_ALREADY_EXISTS.
622 * Otherwise, GetLastError returns zero.
623 * If the function fails, the return value is NULL
624 * Remark :
625 * Status : UNTESTED STUB
626 *
627 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
628 *****************************************************************************/
629
630HANDLE WIN32API CreateWaitableTimerA( LPSECURITY_ATTRIBUTES lpTimerAttributes,
631 BOOL bManualReset, LPCSTR lpTimerName)
632{
633
634 dprintf(("KERNEL32: CreateWaitableTimer(%08x,%08x,%08x) not implemented\n",
635 lpTimerAttributes, bManualReset, lpTimerName
636 ));
637
638 return (NULL);
639}
640
641/*****************************************************************************
642 * Name : HANDLE WIN23API CreateWaitableTimerW
643 * Purpose : The CreateWaitableTimerW function creates a "waitable" timer object.
644 * Parameters: LPSECURITY_ATTRIBUTES lpTimerAttributes pointer to security attributes
645 * BOOL bManualReset flag for manual reset state
646 * LPCTSTR lpTimerName pointer to timer object name
647 * Variables :
648 * Result : If the function succeeds, the return value is a handle to the
649 * timer object. If the named timer object exists before the
650 * function call, GetLastError returns ERROR_ALREADY_EXISTS.
651 * Otherwise, GetLastError returns zero.
652 * If the function fails, the return value is NULL
653 * Remark :
654 * Status : UNTESTED STUB
655 *
656 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
657 *****************************************************************************/
658
659HANDLE WIN32API CreateWaitableTimerW( LPSECURITY_ATTRIBUTES lpTimerAttributes,
660 BOOL bManualReset, LPCWSTR lpTimerName)
661{
662
663 dprintf(("KERNEL32: CreateWaitableTimer(%08x,%08x,%08x) not implemented\n",
664 lpTimerAttributes, bManualReset, lpTimerName
665 ));
666
667 return (NULL);
668}
669
670/*****************************************************************************
671 * Name : BOOL WIN32API DebugActiveProcess
672 * Purpose : The DebugActiveProcess function allows a debugger to attach to
673 * an active process and then debug it.
674 * Parameters: DWORD dwProcessId process to be debugged
675 * Variables :
676 * Result : If the function succeeds, the return value is nonzero.
677 * If the function fails, the return value is zero
678 * Remark :
679 * Status : UNTESTED STUB
680 *
681 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
682 *****************************************************************************/
683
684BOOL WIN32API DebugActiveProcess(DWORD dwProcessId)
685{
686
687 dprintf(("KERNEL32:DebugActiveProcess(%08x) not implemented\n",
688 dwProcessId
689 ));
690
691 return (FALSE);
692}
693
694
695/*****************************************************************************
696 * Name : VOID WIN32API DeleteFiber
697 * Purpose : The DeleteFiber function deletes an existing fiber
698 * Parameters: LPVOID lpFiber pointer to the fiber to delete
699 * Variables :
700 * Result : No returnvalue
701 * Remark : The DeleteFiber function deletes all data associated with the
702 * fiber. This data includes the stack, a subset of the registers,
703 * and the fiber data. If the currently running fiber calls
704 * DeleteFiber, the ExitThread function is called and the thread
705 * terminates. If the currently running fiber is deleted by another
706 * thread, the thread associated with the fiber is likely to
707 * terminate abnormally because the fiber stack has been freed.
708 * Status : UNTESTED STUB
709 *
710 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
711 *****************************************************************************/
712
713VOID WIN32API DeleteFiber(LPVOID lpFiber)
714{
715
716 dprintf(("KERNEL32: DeleteFiber(%08x) not implemented\n",
717 lpFiber
718 ));
719}
720/*****************************************************************************
721 * Name : BOOL WIN3API EndUpdateResourceA
722 * Purpose : The EndUpdateResourceA function ends a resource update
723 * in an executable file.
724 * Parameters: HANDLE hUpdate update-file handle
725 * BOOL fDiscard write flag
726 * Variables :
727 * Result : If the function succeeds and the accumulated resource
728 * modifications specified by calls to the UpdateResource function
729 * are written to the specified executable file,
730 * the return value is nonzero.
731 * If the function fails, the return value is zero
732 * Remark :
733 * Status : UNTESTED STUB
734 *
735 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
736 *****************************************************************************/
737
738BOOL WIN32API EndUpdateResourceA(HANDLE hUpdate,BOOL fDiscard)
739{
740
741 dprintf(("KERNEL32:EndUpdateResourceA(%08x,%08x)not implemented\n",
742 hUpdate, fDiscard
743 ));
744
745 return (FALSE);
746}
747
748/*****************************************************************************
749 * Name : BOOL WIN3API EndUpdateResourceW
750 * Purpose : The EndUpdateResourceW function ends a resource update
751 * in an executable file.
752 * Parameters: HANDLE hUpdate update-file handle
753 * BOOL fDiscard write flag
754 * Variables :
755 * Result : If the function succeeds and the accumulated resource
756 * modifications specified by calls to the UpdateResource function
757 * are written to the specified executable file,
758 * the return value is nonzero.
759 * If the function fails, the return value is zero
760 * Remark :
761 * Status : UNTESTED STUB
762 *
763 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
764 *****************************************************************************/
765
766BOOL WIN32API EndUpdateResourceW(HANDLE hUpdate,BOOL fDiscard)
767{
768
769 dprintf(("KERNEL32:EndUpdateResourceW(%08x,%08x) not implemented\n",
770 hUpdate, fDiscard
771 ));
772
773 return (FALSE);
774}
775
776
777/*****************************************************************************
778 * Name : DWORD WIN32API EraseTape
779 * Purpose : The EraseTape function erases all or part of a tape.
780 * Parameters: HANDLE hDevice handle to open device
781 * DWORD dwEraseType type of erasure to perform
782 * BOOL bImmediate return after erase operation begins
783 * Variables :
784 * Result : If the function succeeds, the return value is NO_ERROR.
785 * If the function fails, the return value is like in
786 * CreateTapePartition
787 * Remark : Some tape devices do not support certain tape operations. To de
788 * termine your tape device's capabilities, see your tape device
789 * documentation and use the GetTapeParameters function
790 * Status : UNTESTED STUB
791 *
792 * Author : Markus Montkowski [Tha, 1998/05/21 20:57]
793 *****************************************************************************/
794
795DWORD WIN32API EraseTape( HANDLE hDevice, DWORD dwEraseType, BOOL bImmediate)
796{
797
798 dprintf(("KERNEL32: EraseTape(%08x,%08x,%08x) not implemented - ERROR_NOT_SUPPORTED\n",
799 hDevice, dwEraseType, bImmediate
800 ));
801
802 return (ERROR_NOT_SUPPORTED);
803}
804
805/*****************************************************************************
806 * Name : int WIN32API FoldStringA
807 * Purpose : The FoldStringW function maps one string to another, performing
808 * a specified transformation option.
809 * Parameters: DWORD dwMapFlags, // mapping transformation options
810 * LPCSTR lpSrcStr, // pointer to source string
811 * int cchSrc, // size of source string, in bytes or characters
812 * LPSTR lpDestStr, // pointer to destination buffer
813 * int cchDest // size of destination buffer, in bytes or characters
814 * Variables :
815 * Result : If the function succeeds, the return value is the number of bytes
816 * (ANSI version) or characters (Unicode version) written to the
817 * destination buffer, or if the cchDest parameter is zero,
818 * the number of bytes or characters required to hold the mapped
819 * string.
820 * If the function fails, the return value is zero
821 * Remark :
822 * Status : UNTESTED STUB
823 *
824 * Author : Markus Montkowski [Tha, 1998/05/21 20:57]
825 *****************************************************************************/
826
827int WIN32API FoldStringA( DWORD dwMapFlags, LPCSTR lpSrcStr,
828 int cchSrc, LPSTR lpDestStr, int cchDest)
829{
830
831 dprintf(("KERNEL32: FoldStringA(%08x,%08x,%08x,%08x,%08x) not implemented\n",
832 dwMapFlags, lpSrcStr, cchSrc, lpDestStr, cchDest
833 ));
834
835 return (0);
836}
837
838/*****************************************************************************
839 * Name : int WIN32API FoldStringW
840 * Purpose : The FoldStringW function maps one string to another, performing
841 * a specified transformation option.
842 * Parameters: DWORD dwMapFlags, // mapping transformation options
843 * LPCSTR lpSrcStr, // pointer to source string
844 * int cchSrc, // size of source string, in bytes or characters
845 * LPSTR lpDestStr, // pointer to destination buffer
846 * int cchDest // size of destination buffer, in bytes or characters
847 * Variables :
848 * Result : If the function succeeds, the return value is the number of bytes
849 * (ANSI version) or characters (Unicode version) written to the
850 * destination buffer, or if the cchDest parameter is zero,
851 * the number of bytes or characters required to hold the mapped
852 * string.
853 * If the function fails, the return value is zero
854 * Remark :
855 * Status : UNTESTED STUB
856 *
857 * Author : Markus Montkowski [Tha, 1998/05/21 20:57]
858 *****************************************************************************/
859
860int WIN32API FoldStringW( DWORD dwMapFlags, LPCWSTR lpSrcStr,
861 int cchSrc, LPWSTR lpDestStr, int cchDest)
862{
863
864 dprintf(("KERNEL32: FoldStringA(%08x,%08x,%08x,%08x,%08x) not implemented\n",
865 dwMapFlags, lpSrcStr, cchSrc, lpDestStr, cchDest
866 ));
867
868 return (0);
869}
870
871
872
873/*****************************************************************************
874 * Name : BOOL GetQueuedCompletionStatus
875 * Purpose : The GetQueuedCompletionStatus function attempts to dequeue an
876 * I/O completion packet from a specified input/output completion
877 * port. If there is no completion packet queued, the function waits
878 * for a pending input/output operation associated with the completion
879 * port to complete. The function returns when it can dequeue a
880 * completion packet, or optionally when the function times out. If
881 * the function returns because of an I/O operation completion, it
882 * sets several variables that provide information about the operation.
883 * Parameters: HANDLE CompletionPort the I/O completion port of interest
884 * LPDWORD lpNumberOfBytesTransferred to receive number of bytes transferred during I/O
885 * LPDWORD lpCompletionKey to receive file's completion key
886 * LPOVERLAPPED * lpOverlapped to receive pointer to OVERLAPPED structure
887 * DWORD dwMilliseconds optional timeout value
888 * Variables :
889 * Result : TRUE / FALSE
890 * Remark :
891 * Status : UNTESTED STUB
892 *
893 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
894 *****************************************************************************/
895
896BOOL WIN32API GetQueuedCompletionStatus(HANDLE CompletionPort,
897 LPDWORD lpNumberOfBytesTransferred,
898 LPDWORD lpCompletionKey,
899 LPOVERLAPPED *lpOverlapped,
900 DWORD dwMilliseconds)
901{
902 dprintf(("Kernel32: GetQueuedCompletionStatus(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.",
903 CompletionPort,
904 lpNumberOfBytesTransferred,
905 lpCompletionKey,
906 lpOverlapped,
907 dwMilliseconds));
908
909 return (FALSE);
910}
911
912
913
914/*****************************************************************************
915 * Name : BOOL GetSystemTimeAdjustment
916 * Purpose : The GetSystemTimeAdjustment function determines whether the system
917 * is applying periodic time adjustments to its time-of-day clock
918 * at each clock interrupt, along with the value and period of any
919 * such adjustments. Note that the period of such adjustments is
920 * equivalent to the time period between clock interrupts.
921 * Parameters: PDWORD lpTimeAdjustment
922 * size, in 100-nanosecond units, of a periodic time adjustment
923 * PDWORD lpTimeIncrement
924 * time, in 100-nanosecond units, between periodic time adjustments
925 * PBOOL lpTimeAdjustmentDisabled
926 * whether periodic time adjustment is disabled or enabled
927 * Variables :
928 * Result : TRUE / FALSE
929 * Remark :
930 * Status : UNTESTED STUB
931 *
932 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
933 *****************************************************************************/
934
935BOOL WIN32API GetSystemTimeAdjustment(PDWORD lpTimeAdjustment,
936 PDWORD lpTimeIncrement,
937 PBOOL lpTimeAdjustmentDisabled)
938{
939 dprintf(("KERNEL32: GetSystemTimeAdjustment(%08xh,%08xh,%08xh) not implemented.\n",
940 lpTimeAdjustment,
941 lpTimeIncrement,
942 lpTimeAdjustmentDisabled));
943
944 return (FALSE);
945}
946
947
948/*****************************************************************************
949 * Name : BOOL GetTapeParameters
950 * Purpose : The GetTapeParameters function retrieves information that
951 * describes the tape or the tape drive.
952 * Parameters: HANDLE hDevice handle of open device
953 * DWORD dwOperation type of information requested
954 * LPDWORD lpdwSize address of returned information
955 * LPVOID lpTapeInformation tape media or drive information
956 * Variables :
957 * Result : API returncode
958 * Remark :
959 * Status : UNTESTED STUB
960 *
961 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
962 *****************************************************************************/
963
964DWORD WIN32API GetTapeParameters(HANDLE hDevice,
965 DWORD dwOperation,
966 LPDWORD lpdwSize,
967 LPVOID lpTapeInformation)
968{
969 dprintf(("KERNEL32: GetTapeParameters(%08xh,%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
970 hDevice,
971 dwOperation,
972 lpdwSize,
973 lpTapeInformation));
974
975 return (ERROR_NOT_SUPPORTED);
976}
977
978
979/*****************************************************************************
980 * Name : BOOL GetTapePosition
981 * Purpose : The GetTapePosition function retrieves the current address of
982 * the tape, in logical or absolute blocks.
983 * Parameters: HANDLE hDevice handle of open device
984 * DWORD dwPositionType type of address to obtain
985 * LPDWORD lpdwPartition address of current tape partition
986 * LPDWORD lpdwOffsetLow address of low-order 32 bits of tape position
987 * LPDWORD lpdwOffsetHigh address of high-order 32 bits of tape position
988 * Variables :
989 * Result : TRUE / FALSE
990 * Remark :
991 * Status : UNTESTED STUB
992 *
993 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
994 *****************************************************************************/
995
996DWORD WIN32API GetTapePosition(HANDLE hDevice,
997 DWORD dwPositionType,
998 LPDWORD lpdwPartition,
999 LPDWORD lpdwOffsetLow,
1000 LPDWORD lpdwOffsetHigh)
1001{
1002 dprintf(("KERNEL32: OS2GetTapePosition(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1003 hDevice,
1004 dwPositionType,
1005 lpdwPartition,
1006 lpdwOffsetLow,
1007 lpdwOffsetHigh));
1008
1009 return (ERROR_NOT_SUPPORTED);
1010}
1011
1012
1013/*****************************************************************************
1014 * Name : BOOL GetTapeStatus
1015 * Purpose : The GetTapeStatus function indicates whether the tape device is
1016 * ready to process tape commands.
1017 * Parameters: HANDLE hDevice handle of open device
1018 * Variables :
1019 * Result : API returncode
1020 * Remark :
1021 * Status : UNTESTED STUB
1022 *
1023 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1024 *****************************************************************************/
1025
1026DWORD WIN32API GetTapeStatus(HANDLE hDevice)
1027{
1028 dprintf(("KERNEL32: OS2GetTapeStatus(%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1029 hDevice));
1030
1031 return (ERROR_NOT_SUPPORTED);
1032}
1033
1034
1035/*****************************************************************************
1036 * Name : BOOL GetThreadSelectorEntry
1037 * Purpose : The GetThreadSelectorEntry function retrieves a descriptor table
1038 * entry for the specified selector and thread.
1039 * Parameters: HANDLE hThread handle of thread that contains selector
1040 * DWORD dwSelector number of selector value to look up
1041 * LPLDT_ENTRY lpSelectorEntry address of selector entry structure
1042 * Variables :
1043 * Result : TRUE / FALSE
1044 * Remark :
1045 * Status : UNTESTED STUB
1046 *
1047 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1048 *****************************************************************************/
1049
1050BOOL WIN32API GetThreadSelectorEntry(HANDLE hThread,
1051 DWORD dwSelector,
1052 LPLDT_ENTRY lpSelectorEntry)
1053{
1054 dprintf(("KERNEL32: GetThreadSelectorEntry(%08xh,%08xh,%08xh) not implemented.\n",
1055 hThread,
1056 dwSelector,
1057 lpSelectorEntry));
1058
1059 return (FALSE);
1060}
1061
1062
1063
1064
1065
1066/*****************************************************************************
1067 * Name : BOOL PostQueuedCompletionStatus
1068 * Purpose : The PostQueuedCompletionStatus function lets you post an I/O
1069 * completion packet to an I/O completion port. The I/O completion
1070 * packet will satisfy an outstanding call to the GetQueuedCompletionStatus
1071 * function. The GetQueuedCompletionStatus function returns with the three
1072 * values passed as the second, third, and fourth parameters of the call
1073 * to PostQueuedCompletionStatus.
1074 * Parameters: HANDLE CompletionPort handle to an I/O completion port
1075 * DWORD dwNumberOfBytesTransferred
1076 * DWORD dwCompletionKey
1077 * LPOVERLAPPED lpOverlapped
1078 * Variables :
1079 * Result : TRUE / FALSE
1080 * Remark :
1081 * Status : UNTESTED STUB
1082 *
1083 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1084 *****************************************************************************/
1085
1086BOOL WIN32API PostQueuedCompletionStatus(HANDLE CompletionPort,
1087 DWORD dwNumberOfBytesTransferred,
1088 DWORD dwCompletionKey,
1089 LPOVERLAPPED lpOverlapped)
1090{
1091 dprintf(("Kernel32: PostQueuedCompletionStatus(%08xh,%08xh,%08xh,%08xh) not implemented.",
1092 CompletionPort,
1093 dwNumberOfBytesTransferred,
1094 dwCompletionKey,
1095 lpOverlapped));
1096
1097 return (FALSE);
1098}
1099
1100
1101/*****************************************************************************
1102 * Name : DWORD PrepareTape
1103 * Purpose : The PrepareTape function prepares the tape to be accessed or removed.
1104 * Parameters: HANDLE hDevice handle of open device
1105 * DWORD dwOperation preparation method
1106 * BOOL bImmediate return after operation begins
1107 * Variables :
1108 * Result : API returncode
1109 * Remark :
1110 * Status : UNTESTED STUB
1111 *
1112 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1113 *****************************************************************************/
1114
1115DWORD WIN32API PrepareTape(HANDLE hDevice,
1116 DWORD dwOperation,
1117 BOOL bImmediate)
1118{
1119 dprintf(("Kernel32: PrepareTape(%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1120 hDevice,
1121 dwOperation,
1122 bImmediate));
1123
1124 return (ERROR_NOT_SUPPORTED);
1125}
1126
1127
1128/*****************************************************************************
1129 * Name : BOOL ReadProcessMemory
1130 * Purpose : The ReadProcessMemory function reads memory in a specified process.
1131 * The entire area to be read must be accessible, or the operation fails.
1132 * Parameters: HANDLE hProcess handle of the process whose memory is read
1133 * LPCVOID lpBaseAddress address to start reading
1134 * LPVOID lpBuffer address of buffer to place read data
1135 * DWORD cbRead number of bytes to read
1136 * LPDWORD lpNumberOfBytesRead address of number of bytes read
1137 * Variables :
1138 * Result : TRUE / FALSE
1139 * Remark :
1140 * Status : UNTESTED STUB
1141 *
1142 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1143 *****************************************************************************/
1144
1145BOOL WIN32API ReadProcessMemory(HANDLE hProcess,
1146 LPCVOID lpBaseAddress,
1147 LPVOID lpBuffer,
1148 DWORD cbRead,
1149 LPDWORD lpNumberOfBytesRead)
1150{
1151 dprintf(("Kernel32: ReadProcessMemory(%08xh,%08xh,%08xh,%08xh,%08xh) not completely implemented",
1152 hProcess,
1153 lpBaseAddress,
1154 lpBuffer,
1155 cbRead,
1156 lpNumberOfBytesRead));
1157
1158 // do some (faked) access check
1159 if(hProcess != GetCurrentProcess())
1160 {
1161 dprintf(("WARNING: ReadProcessMemory: can't read memory from other processes!"));
1162 SetLastError(ERROR_ACCESS_DENIED);
1163 return FALSE;
1164 }
1165
1166 if(IsBadReadPtr(lpBaseAddress, cbRead)) {
1167 dprintf(("ERROR: ReadProcessMemory bad source pointer!"));
1168 if(lpNumberOfBytesRead)
1169 *lpNumberOfBytesRead = 0;
1170 SetLastError(ERROR_ACCESS_DENIED);
1171 return FALSE;
1172 }
1173 // FIXME: check this, if we ever run win32 binaries in different addressspaces
1174 // ... and add a sizecheck
1175 memcpy(lpBuffer,lpBaseAddress,cbRead);
1176 if(lpNumberOfBytesRead)
1177 *lpNumberOfBytesRead = cbRead;
1178
1179 SetLastError(ERROR_SUCCESS);
1180 return TRUE;
1181}
1182
1183/*****************************************************************************
1184 * Name : DWORD WriteProcessMemory
1185 * Purpose : The WriteProcessMemory function writes memory in a specified
1186 * process. The entire area to be written to must be accessible,
1187 * or the operation fails.
1188 * Parameters: HANDLE hProcess handle of process whose memory is written to
1189 * LPVOID lpBaseAddress address to start writing to
1190 * LPVOID lpBuffer address of buffer to write data to
1191 * DWORD cbWrite number of bytes to write
1192 * LPDWORD lpNumberOfBytesWritten actual number of bytes written
1193 * Variables :
1194 * Result : TRUE / FALSE
1195 * Remark :
1196 * Status : UNTESTED STUB
1197 *
1198 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1199 *****************************************************************************/
1200
1201BOOL WIN32API WriteProcessMemory(HANDLE hProcess,
1202 LPCVOID lpBaseAddress,
1203 LPVOID lpBuffer,
1204 DWORD cbWrite,
1205 LPDWORD lpNumberOfBytesWritten)
1206{
1207 // do some (faked) access check
1208 if(hProcess != GetCurrentProcess())
1209 {
1210 dprintf(("Kernel32: WriteProcessMemory(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented (different process!!)",
1211 hProcess, lpBaseAddress, lpBuffer, cbWrite, lpNumberOfBytesWritten));
1212 SetLastError(ERROR_ACCESS_DENIED);
1213 return FALSE;
1214 }
1215 dprintf(("Kernel32: WriteProcessMemory(%08xh,%08xh,%08xh,%08xh,%08xh))",
1216 hProcess,lpBaseAddress, lpBuffer, cbWrite, lpNumberOfBytesWritten));
1217
1218 if(IsBadWritePtr((LPVOID)lpBaseAddress, cbWrite))
1219 {
1220 dprintf(("ERROR: WriteProcessMemory bad destination pointer!"));
1221 if(lpNumberOfBytesWritten)
1222 *lpNumberOfBytesWritten = 0;
1223 SetLastError(ERROR_ACCESS_DENIED);
1224 return FALSE;
1225 }
1226
1227 // FIXME: check this, if we ever run win32 binaries in different addressspaces
1228 // ... and add a sizecheck
1229 memcpy((void*)lpBaseAddress,lpBuffer,cbWrite);
1230 if(lpNumberOfBytesWritten)
1231 *lpNumberOfBytesWritten = cbWrite;
1232
1233 SetLastError(ERROR_SUCCESS);
1234 return TRUE;
1235}
1236
1237
1238/*****************************************************************************
1239 * Name : BOOL SetComputerNameA
1240 * Purpose : The SetComputerNameA function sets the computer name to be used
1241 * the next time the system is restarted.
1242 * Parameters: LPCTSTR lpszName address of new computer name
1243 * Variables :
1244 * Result : TRUE / FALSE
1245 * Remark :
1246 * Status : UNTESTED STUB
1247 *
1248 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1249 *****************************************************************************/
1250
1251BOOL WIN32API SetComputerNameA(LPCTSTR lpszName)
1252{
1253 dprintf(("Kernel32: SetComputerNameA(%s) not implemented.\n",
1254 lpszName));
1255
1256 return (FALSE);
1257}
1258
1259
1260/*****************************************************************************
1261 * Name : BOOL SetComputerNameW
1262 * Purpose : The SetComputerNameW function sets the computer name to be used
1263 * the next time the system is restarted.
1264 * Parameters: LPCTSTR lpszName address of new computer name
1265 * Variables :
1266 * Result : TRUE / FALSE
1267 * Remark :
1268 * Status : UNTESTED STUB
1269 *
1270 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1271 *****************************************************************************/
1272
1273BOOL WIN32API SetComputerNameW(LPCWSTR lpszName)
1274{
1275 dprintf(("Kernel32: SetComputerNameW(%s) not implemented.\n",
1276 lpszName));
1277
1278 return (FALSE);
1279}
1280
1281
1282/*****************************************************************************
1283 * Name : VOID SetFileApisToOEM
1284 * Purpose : The SetFileApisToOEM function causes a set of Win32 file functions
1285 * to use the OEM character set code page. This function is useful
1286 * for 8-bit console input and output operations.
1287 * Parameters: VOID
1288 * Variables :
1289 * Result :
1290 * Remark :
1291 * Status : UNTESTED STUB
1292 *
1293 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1294 *****************************************************************************/
1295
1296VOID WIN32API SetFileApisToOEM(VOID)
1297{
1298 dprintf(("Kernel32: SetFileApisToOEM() not implemented.\n"));
1299}
1300
1301/*****************************************************************************
1302 * Name : BOOL SetSystemPowerState
1303 * Purpose : The SetSystemPowerState function suspends the system by shutting
1304 * power down. Depending on the ForceFlag parameter, the function
1305 * either suspends operation immediately or requests permission from
1306 * all applications and device drivers before doing so.
1307 * Parameters: BOOL fSuspend
1308 * BOOL fForce
1309 * Variables :
1310 * Result : TRUE / FALSE
1311 * Remark :
1312 * Status : UNTESTED STUB
1313 *
1314 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1315 *****************************************************************************/
1316
1317BOOL WIN32API SetSystemPowerState(BOOL fSuspend,
1318 BOOL fForce)
1319{
1320 dprintf(("KERNEL32: SetSystemPowerState(%08xh,%08xh) not implemented.\n",
1321 fSuspend,
1322 fForce));
1323
1324 return (FALSE);
1325}
1326
1327
1328/*****************************************************************************
1329 * Name : BOOL SetSystemTimeAdjustment
1330 * Purpose : The SetSystemTimeAdjustment function tells the system to enable
1331 * or disable periodic time adjustments to its time of day clock.
1332 * Such time adjustments are used to synchronize the time of day
1333 * with some other source of time information. When periodic time
1334 * adjustments are enabled, they are applied at each clock interrupt.
1335 * Parameters: DWORD dwTimeAdjustment
1336 * BOOL bTimeAdjustmentDisabled
1337 * Variables :
1338 * Result : TRUE / FALSE
1339 * Remark :
1340 * Status : UNTESTED STUB
1341 *
1342 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1343 *****************************************************************************/
1344
1345BOOL WIN32API SetSystemTimeAdjustment(DWORD dwTimeAdjustment,
1346 BOOL bTimeAdjustmentDisabled)
1347{
1348 dprintf(("KERNEL32: SetSystemTimeAdjustment(%08xh,%08xh) not implemented.\n",
1349 dwTimeAdjustment,
1350 bTimeAdjustmentDisabled));
1351
1352 return (FALSE);
1353}
1354
1355
1356/*****************************************************************************
1357 * Name : BOOL SetTapeParameters
1358 * Purpose : The SetTapeParameters function either specifies the block size
1359 * of a tape or configures the tape device.
1360 * Parameters: HANDLE hDevice handle of open device
1361 * DWORD dwOperation type of information to set
1362 * LPVOID lpTapeInformation address of buffer with information to set
1363 * Variables :
1364 * Result : API returncode
1365 * Remark :
1366 * Status : UNTESTED STUB
1367 *
1368 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1369 *****************************************************************************/
1370
1371BOOL WIN32API SetTapeParameters(HANDLE hDevice,
1372 DWORD dwOperation,
1373 LPVOID lpTapeInformation)
1374{
1375 dprintf(("KERNEL32: SetTapeParameters(%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1376 hDevice,
1377 dwOperation,
1378 lpTapeInformation));
1379
1380 SetLastError(ERROR_NOT_SUPPORTED);
1381 return FALSE;
1382}
1383
1384
1385/*****************************************************************************
1386 * Name : DWORD SetTapePosition
1387 * Purpose : The SetTapePosition sets the tape position on the specified device.
1388 * Parameters: HANDLE hDevice handle of open device
1389 * DWORD dwPositionMethod type of positioning to perform
1390 * DWORD dwPartition new tape partition
1391 * DWORD dwOffsetLow low-order 32 bits of tape position
1392 * DWORD dwOffsetHigh high-order 32 bits of tape position
1393 * BOOL bImmediate return after operation begins
1394 * Variables :
1395 * Result : API returncode
1396 * Remark :
1397 * Status : UNTESTED STUB
1398 *
1399 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1400 *****************************************************************************/
1401
1402BOOL WIN32API SetTapePosition(HANDLE hDevice,
1403 DWORD dwPositionMethod,
1404 DWORD dwPartition,
1405 DWORD dwOffsetLow,
1406 DWORD dwOffsetHigh,
1407 BOOL bImmediate)
1408{
1409 dprintf(("KERNEL32: SetTapePosition(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1410 hDevice,
1411 dwPositionMethod,
1412 dwPartition,
1413 dwOffsetLow,
1414 dwOffsetHigh,
1415 bImmediate));
1416
1417 return (ERROR_NOT_SUPPORTED);
1418}
1419
1420
1421
1422
1423/*****************************************************************************
1424 * Name : BOOL UpdateResourceA
1425 * Purpose : The UpdateResourceA function adds, deletes, or replaces a resource
1426 * in an executable file.
1427 * Parameters: HANDLE hUpdateFile update-file handle
1428 * LPCTSTR lpszType address of resource type to update
1429 * LPCTSTR lpszName address of resource name to update
1430 * WORD IDLanguage language identifier of resource
1431 * LPVOID lpvData address of resource data
1432 * DWORD cbData length of resource data, in bytes
1433 * Variables :
1434 * Result : TRUE / FALSE
1435 * Remark :
1436 * Status : UNTESTED STUB
1437 *
1438 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1439 *****************************************************************************/
1440
1441BOOL WIN32API UpdateResourceA(HANDLE hUpdateFile,
1442 LPCTSTR lpszType,
1443 LPCTSTR lpszName,
1444 WORD IDLanguage,
1445 LPVOID lpvData,
1446 DWORD cbData)
1447{
1448 dprintf(("KERNEL32: UpdateResourceA(%08xh,%s,%s,%08xh,%08xh,%08xh) not implemented.\n",
1449 hUpdateFile,
1450 lpszType,
1451 lpszName,
1452 IDLanguage,
1453 lpvData,
1454 cbData));
1455
1456 return (FALSE);
1457}
1458
1459
1460/*****************************************************************************
1461 * Name : BOOL UpdateResourceW
1462 * Purpose : The UpdateResourceW function adds, deletes, or replaces a resource
1463 * in an executable file.
1464 * Parameters: HANDLE hUpdateFile update-file handle
1465 * LPCTSTR lpszType address of resource type to update
1466 * LPCTSTR lpszName address of resource name to update
1467 * WORD IDLanguage language identifier of resource
1468 * LPVOID lpvData address of resource data
1469 * DWORD cbData length of resource data, in bytes
1470 * Variables :
1471 * Result : TRUE / FALSE
1472 * Remark :
1473 * Status : UNTESTED STUB
1474 *
1475 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1476 *****************************************************************************/
1477
1478BOOL WIN32API UpdateResourceW(HANDLE hUpdateFile,
1479 LPCWSTR lpszType,
1480 LPCWSTR lpszName,
1481 WORD IDLanguage,
1482 LPVOID lpvData,
1483 DWORD cbData)
1484{
1485 dprintf(("KERNEL32: UpdateResourceW(%08xh,%s,%s,%08xh,%08xh,%08xh) not implemented.\n",
1486 hUpdateFile,
1487 lpszType,
1488 lpszName,
1489 IDLanguage,
1490 lpvData,
1491 cbData));
1492
1493 return (FALSE);
1494}
1495
1496/*****************************************************************************
1497 * Name : BOOL WriteTapemark
1498 * Purpose : The WriteTapemark function writes a specified number of filemarks,
1499 * setmarks, short filemarks, or long filemarks to a tape device.
1500 * These tapemarks divide a tape partition into smaller areas.
1501 * Parameters: HANDLE hDevice handle of open device
1502 * DWORD dwTapemarkType type of tapemarks to write
1503 * DWORD dwTapemarkCount number of tapemarks to write
1504 * BOOL bImmediate return after write begins
1505 * Variables :
1506 * Result : API returncode
1507 * Remark :
1508 * Status : UNTESTED STUB
1509 *
1510 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1511 *****************************************************************************/
1512
1513DWORD WIN32API WriteTapemark(HANDLE hDevice,
1514 DWORD dwTapemarkType,
1515 DWORD dwTapemarkCount,
1516 BOOL bImmediate)
1517{
1518 dprintf(("KERNEL32: WriteTapemark(%08xh,%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1519 hDevice,
1520 dwTapemarkType,
1521 dwTapemarkCount,
1522 bImmediate));
1523
1524 return (ERROR_NOT_SUPPORTED);
1525}
1526
1527
1528/*****************************************************************************
1529 * Name : DWORD CmdBatNotification
1530 * Purpose : Unknown, used by /winnt/cmd.exe
1531 * Parameters: Unknown (wrong)
1532 * Variables :
1533 * Result : Unknown
1534 * Remark :
1535 * Status : UNTESTED STUB
1536 *
1537 * Author : Patrick Haller [Tue, 1999/06/08 21:44]
1538 *****************************************************************************/
1539
1540DWORD WIN32API CmdBatNotification(DWORD x1)
1541{
1542 dprintf(("KERNEL32: CmdBatNotification(%08xh) not implemented\n",
1543 x1));
1544
1545 return (0);
1546}
1547
1548
1549/*****************************************************************************
1550 * Name : DWORD GetVDMCurrentDirectories
1551 * Purpose : Unknown, used by /winnt/cmd.exe
1552 * Parameters: Unknown (wrong)
1553 * Variables :
1554 * Result : Unknown
1555 * Remark :
1556 * Status : UNTESTED STUB
1557 *
1558 * Author : Patrick Haller [Tue, 1999/06/08 21:44]
1559 *****************************************************************************/
1560
1561DWORD WIN32API GetVDMCurrentDirectories(DWORD x1)
1562{
1563 dprintf(("KERNEL32: GetVDMCurrentDirectories(%08xh) not implemented\n",
1564 x1));
1565
1566 return (0);
1567}
1568
1569
Note: See TracBrowser for help on using the repository browser.