wshom.idl 17.4 KB
Newer Older
Jacek Caban's avatar
Jacek Caban committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Copyright 2011 Jacek Caban for CodeWeavers
 *
 * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

19
#pragma makedep regtypelib
20

Jacek Caban's avatar
Jacek Caban committed
21
import "oaidl.idl";
22
cpp_quote("#undef ExpandEnvironmentStrings")
Jacek Caban's avatar
Jacek Caban committed
23 24 25 26 27 28 29 30 31 32

[
    helpstring("Windows Script Host Object Model"),
    uuid(f935dc20-1cf0-11d0-adb9-00c04fd58a0b),
    version(1.0)
]
library IWshRuntimeLibrary
{
    importlib("stdole2.tlb");

33 34 35 36 37 38
    typedef enum {
        WshRunning  = 0,
        WshFinished,
        WshFailed
    } WshExecStatus;

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
    typedef enum {
        UnknownType = 0,
        Removable,
        Fixed,
        Remote,
        CDRom,
        RamDisk
    } DriveTypeConst;

    typedef enum {
        Normal     = 0x000,
        ReadOnly   = 0x001,
        Hidden     = 0x002,
        System     = 0x004,
        Volume     = 0x008,
        Directory  = 0x010,
        Archive    = 0x020,
        Alias      = 0x400,
        Compressed = 0x800
    } FileAttribute;

    typedef enum {
        ForReading   = 0x1,
        ForWriting   = 0x2,
        ForAppending = 0x8
    } IOMode;

    typedef enum {
        TristateTrue       = -1,
        TristateFalse      =  0,
        TristateUseDefault = -2,
        TristateMixed      = -2
    } Tristate;

    interface IFolder;
    interface IFolderCollection;

76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
    [
        uuid(53bad8c1-e718-11cf-893d-00a0c9054228),
        odl,
        hidden,
        dual,
        nonextensible,
        oleautomation
    ]
    interface ITextStream : IDispatch {
        [id(0x2710), propget]
        HRESULT Line([out, retval] long* Line);

        [id(0xfffffdef), propget]
        HRESULT Column([out, retval] long* Column);

        [id(0x2712), propget]
        HRESULT AtEndOfStream([out, retval] VARIANT_BOOL* EOS);

        [id(0x2713), propget]
        HRESULT AtEndOfLine([out, retval] VARIANT_BOOL* EOL);

        [id(0x2714)]
        HRESULT Read([in] long Characters, [out, retval] BSTR* Text);

        [id(0x2715)]
        HRESULT ReadLine([out, retval] BSTR* Text);

        [id(0x2716)]
        HRESULT ReadAll([out, retval] BSTR* Text);

        [id(0x2717)]
        HRESULT Write([in] BSTR Text);

        [id(0x2718)]
110
        HRESULT WriteLine([in, defaultvalue("")] BSTR Text);
111 112 113 114 115 116 117 118 119 120 121 122 123 124

        [id(0x2719)]
        HRESULT WriteBlankLines([in] long Lines);

        [id(0x271a)]
        HRESULT Skip([in] long Characters);

        [id(0x271b)]
        HRESULT SkipLine();

        [id(0x271c)]
        HRESULT Close();
    };

125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
    [
        uuid(c7c3f5a0-88a3-11d0-abcb-00a0c90fffc0),
        odl,
        hidden,
        dual,
        nonextensible,
        oleautomation
    ]
    interface IDrive : IDispatch {
        [id(DISPID_VALUE), propget]
        HRESULT Path([out, retval] BSTR* path);

        [id(0x2710), propget]
        HRESULT DriveLetter([out, retval] BSTR* letter);

        [id(0x2711), propget]
        HRESULT ShareName([out, retval] BSTR* ShareName);

        [id(0x2712), propget]
        HRESULT DriveType([out, retval] DriveTypeConst* type);

        [id(0x2713), propget]
        HRESULT RootFolder([out, retval] IFolder** folder);

        [id(0x2715), propget]
        HRESULT AvailableSpace([out, retval] VARIANT* Avail);

        [id(0x2714), propget]
        HRESULT FreeSpace([out, retval] VARIANT* pFree);

        [id(0x2716), propget]
        HRESULT TotalSize([out, retval] VARIANT* Total);

        [id(0x2717), propget]
        HRESULT VolumeName([out, retval] BSTR* Name);

        [id(0x2717), propput]
        HRESULT VolumeName([in] BSTR Name);

        [id(0x2718), propget]
        HRESULT FileSystem([out, retval] BSTR* pFileSystem);

        [id(0x2719), propget]
        HRESULT SerialNumber([out, retval] long* SerialNumber);

        [id(0x271a), propget]
        HRESULT IsReady([out, retval] VARIANT_BOOL* pfReady);
    };

    [
        uuid(c7c3f5a4-88a3-11d0-abcb-00a0c90fffc0),
        odl,
        hidden,
        dual,
        nonextensible,
        oleautomation
    ]
    interface IFile : IDispatch {
        [id(DISPID_VALUE), propget]
        HRESULT Path([out, retval] BSTR* path);

        [id(0x03e8), propget]
        HRESULT Name([out, retval] BSTR* Name);

        [id(0x03e8), propput]
        HRESULT Name([in] BSTR Name);

        [id(0x03ea), propget]
        HRESULT ShortPath([out, retval] BSTR* path);

        [id(0x03e9), propget]
        HRESULT ShortName([out, retval] BSTR* Name);

        [id(0x03ec), propget]
        HRESULT Drive([out, retval] IDrive** drive);

        [id(0x03ed), propget]
        HRESULT ParentFolder([out, retval] IFolder** folder);

        [id(0x03eb), propget]
        HRESULT Attributes([out, retval] FileAttribute* attr);

        [id(0x03eb), propput]
        HRESULT Attributes([in] FileAttribute attr);

        [id(0x03ee), propget]
        HRESULT DateCreated([out, retval] DATE* date);

        [id(0x03ef), propget]
        HRESULT DateLastModified([out, retval] DATE* date);

        [id(0x03f0), propget]
        HRESULT DateLastAccessed([out, retval] DATE* date);

        [id(0x03f1), propget]
        HRESULT Size([out, retval] VARIANT* Size);

        [id(0x03f2), propget]
        HRESULT Type([out, retval] BSTR* Type);

        [id(0x04b0)]
226
        HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL Force);
227 228 229 230

        [id(0x04b2)]
        HRESULT Copy(
                    [in] BSTR Destination,
231
                    [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles);
232 233 234 235 236 237

        [id(0x04b4)]
        HRESULT Move([in] BSTR Destination);

        [id(0x044c)]
        HRESULT OpenAsTextStream(
238 239
                    [in, defaultvalue(1)] IOMode IOMode,
                    [in, defaultvalue(0)] Tristate Format,
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
                    [out, retval] ITextStream** ppts);
    };

    [
        uuid(c7c3f5a5-88a3-11d0-abcb-00a0c90fffc0),
        odl,
        hidden,
        dual,
        nonextensible,
        oleautomation
    ]
    interface IFileCollection : IDispatch {
        [id(DISPID_VALUE), propget]
        HRESULT Item(
                    [in] VARIANT Key,
                    [out, retval] IFile** ppfile);
        [id(DISPID_NEWENUM), propget, restricted, hidden]
        HRESULT _NewEnum([out, retval] IUnknown** ppenum);
        [id(1), propget]
        HRESULT Count([out, retval] long* count);
    };

    [
        uuid(c7c3f5a2-88a3-11d0-abcb-00a0c90fffc0),
        odl,
        hidden,
        dual,
        nonextensible,
        oleautomation
    ]
    interface IFolder : IDispatch {
        [id(DISPID_VALUE), propget]
        HRESULT Path([out, retval] BSTR* path);

        [id(0x03e8), propget]
        HRESULT Name([out, retval] BSTR* name);

        [id(0x03e8), propput]
        HRESULT Name([in] BSTR name);

        [id(0x03ea), propget]
        HRESULT ShortPath([out, retval] BSTR* path);

        [id(0x03e9), propget]
        HRESULT ShortName([out, retval] BSTR* name);

        [id(0x03ec), propget]
        HRESULT Drive([out, retval] IDrive** drive);

        [id(0x03ed), propget]
        HRESULT ParentFolder([out, retval] IFolder** folder);

        [id(0x03eb), propget]
        HRESULT Attributes([out, retval] FileAttribute* attr);

        [id(0x03eb), propput]
        HRESULT Attributes([in] FileAttribute attr);

        [id(0x03ee), propget]
        HRESULT DateCreated([out, retval] DATE* date);

        [id(0x03ef), propget]
        HRESULT DateLastModified([out, retval] DATE* date);

        [id(0x03f0), propget]
        HRESULT DateLastAccessed([out, retval] DATE* date);

        [id(0x03f2), propget]
        HRESULT Type([out, retval] BSTR* type);

        [id(0x04b1)]
311
        HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL force);
312 313 314 315

        [id(0x04b3)]
        HRESULT Copy(
                    [in] BSTR Destination,
316
                    [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles);
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335

        [id(0x04b5)]
        HRESULT Move([in] BSTR Destination);

        [id(0x2710), propget]
        HRESULT IsRootFolder([out, retval] VARIANT_BOOL* root);

        [id(0x03f1), propget]
        HRESULT Size([out, retval] VARIANT* size);

        [id(0x2711), propget]
        HRESULT SubFolders([out, retval] IFolderCollection** folders);

        [id(0x2712), propget]
        HRESULT Files([out, retval] IFileCollection** files);

        [id(0x044d)]
        HRESULT CreateTextFile(
                    [in] BSTR FileName,
336 337
                    [in, defaultvalue(-1)] VARIANT_BOOL Overwrite,
                    [in, defaultvalue(0)] VARIANT_BOOL Unicode,
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
                    [out, retval] ITextStream** ppts);
    };

    [
        uuid(c7c3f5a3-88a3-11d0-abcb-00a0c90fffc0),
        odl,
        hidden,
        dual,
        nonextensible,
        oleautomation
    ]
    interface IFolderCollection : IDispatch {
        [id(2)]
        HRESULT Add(
                    [in] BSTR Name,
                    [out, retval] IFolder** folder);

        [id(DISPID_VALUE), propget]
        HRESULT Item(
                    [in] VARIANT Key,
                    [out, retval] IFolder** folder);

        [id(DISPID_NEWENUM), propget, restricted, hidden]
        HRESULT _NewEnum([out, retval] IUnknown** ppenum);

        [id(1), propget]
        HRESULT Count([out, retval] long* count);
    };

Jacek Caban's avatar
Jacek Caban committed
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
    [
        uuid(f935dc27-1cf0-11d0-adb9-00c04fd58a0b),
        odl,
        dual,
        oleautomation
    ]
    interface IWshCollection : IDispatch {
        [id(DISPID_VALUE)]
        HRESULT Item(
                [in] VARIANT *Index,
                [out, retval] VARIANT *out_Value);

        [id(1)]
        HRESULT Count([out, retval] long *out_Count);

        [id(2), propget]
        HRESULT length([out, retval] long *out_Count);

        [id(DISPID_NEWENUM)]
        HRESULT _NewEnum([out, retval] IUnknown *out_Enum);
    }

    [
        uuid(f935dc29-1cf0-11d0-adb9-00c04fd58a0b),
        odl,
        dual,
        oleautomation
    ]
    interface IWshEnvironment : IDispatch {
        [id(DISPID_VALUE), propget]
        HRESULT Item(
                [in] BSTR Name,
                [out, retval] BSTR *out_Value);

        [id(DISPID_VALUE), propput]
        HRESULT Item(
                [in] BSTR Name,
404
                [in] BSTR Value);
Jacek Caban's avatar
Jacek Caban committed
405 406 407 408 409 410 411 412

        [id(1)]
        HRESULT Count([out, retval] long *out_Count);

        [id(2), propget]
        HRESULT length([out, retval] long *out_Count);

        [id(DISPID_NEWENUM)]
413
        HRESULT _NewEnum([out, retval] IUnknown **out_Enum);
Jacek Caban's avatar
Jacek Caban committed
414 415 416 417 418 419

        [id(0x03e9)]
        HRESULT Remove([in] BSTR Name);
    }

    [
420
        uuid(08fed190-be19-11d3-a28b-00104bd35090),
Jacek Caban's avatar
Jacek Caban committed
421 422 423 424
        odl,
        dual,
        oleautomation
    ]
425 426 427 428 429 430 431 432 433 434 435 436 437 438
    interface IWshExec : IDispatch {
        [id(0x0001), propget]
        HRESULT Status([out, retval] WshExecStatus* Status);

        [id(0x0003), propget]
        HRESULT StdIn([out, retval] ITextStream** stream);

        [id(0x0004), propget]
        HRESULT StdOut([out, retval] ITextStream** stream);

        [id(0x0005), propget]
        HRESULT StdErr([out, retval] ITextStream** stream);

        [id(0x0006), propget]
439
        HRESULT ProcessID([out, retval] DWORD *pid);
440 441

        [id(0x0007), propget]
442
        HRESULT ExitCode([out, retval] DWORD *code);
443 444 445 446 447

        [id(0x0008)]
        HRESULT Terminate();
    };

448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509
    [
        uuid(f935dc23-1cf0-11d0-adb9-00c04fd58a0b),
        odl,
        dual,
        oleautomation
    ]
    interface IWshShortcut : IDispatch {
        [id(DISPID_VALUE), propget]
        HRESULT FullName([out, retval] BSTR* name);

        [id(0x03e8), propget]
        HRESULT Arguments([out, retval] BSTR* Arguments);

        [id(0x03e8), propput]
        HRESULT Arguments([in] BSTR Arguments);

        [id(0x03e9), propget]
        HRESULT Description([out, retval] BSTR* Description);

        [id(0x03e9), propput]
        HRESULT Description([in] BSTR Description);

        [id(0x03ea), propget]
        HRESULT Hotkey([out, retval] BSTR* HotKey);

        [id(0x03ea), propput]
        HRESULT Hotkey([in] BSTR HotKey);

        [id(0x03eb), propget]
        HRESULT IconLocation([out, retval] BSTR* IconPath);

        [id(0x03eb), propput]
        HRESULT IconLocation([in] BSTR IconPath);

        [id(0x03ec), propput]
        HRESULT RelativePath([in] BSTR rhs);

        [id(0x03ed), propget]
        HRESULT TargetPath([out, retval] BSTR* Path);

        [id(0x03ed), propput]
        HRESULT TargetPath([in] BSTR Path);

        [id(0x03ee), propget]
        HRESULT WindowStyle([out, retval] int* ShowCmd);

        [id(0x03ee), propput]
        HRESULT WindowStyle([in] int ShowCmd);

        [id(0x03ef), propget]
        HRESULT WorkingDirectory([out, retval] BSTR* WorkingDirectory);

        [id(0x03ef), propput]
        HRESULT WorkingDirectory([in] BSTR WorkingDirectory);

        [id(0x07d0), hidden]
        HRESULT Load([in] BSTR PathLink);

        [id(0x07d1)]
        HRESULT Save();
    };

510 511 512 513 514 515 516 517
    [
        uuid(f935dc21-1cf0-11d0-adb9-00c04fd58a0b),
        odl,
        dual,
        oleautomation,
        hidden
    ]
    interface IWshShell : IDispatch {
Jacek Caban's avatar
Jacek Caban committed
518
        [id(0x0064), propget]
519
        HRESULT SpecialFolders([out, retval] IWshCollection** out_Folders);
Jacek Caban's avatar
Jacek Caban committed
520 521 522

        [id(0x00c8), propget]
        HRESULT Environment(
523 524
            [in, optional] VARIANT* Type,
            [out, retval] IWshEnvironment** out_Env);
Jacek Caban's avatar
Jacek Caban committed
525 526 527

        [id(0x03e8)]
        HRESULT Run(
528 529 530
            [in] BSTR Command,
            [in, optional] VARIANT* WindowStyle,
            [in, optional] VARIANT* WaitOnReturn,
531
            [out, retval] DWORD* out_ExitCode);
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577

        [id(0x03e9)]
        HRESULT Popup(
            [in] BSTR Text,
            [in, optional] VARIANT* SecondsToWait,
            [in, optional] VARIANT* Title,
            [in, optional] VARIANT* Type,
            [out, retval] int* out_Button);

        [id(0x03ea)]
        HRESULT CreateShortcut(
            [in] BSTR PathLink,
            [out, retval] IDispatch** out_Shortcut);

        [id(0x03ee)]
        HRESULT ExpandEnvironmentStrings(
            [in] BSTR Src,
            [out, retval] BSTR* out_Dst);

        [id(0x07d0)]
        HRESULT RegRead(
            [in] BSTR Name,
            [out, retval] VARIANT* out_Value);

        [id(0x07d1)]
        HRESULT RegWrite(
            [in] BSTR Name,
            [in] VARIANT* Value,
            [in, optional] VARIANT* Type);

        [id(0x07d2)]
        HRESULT RegDelete([in] BSTR Name);
    };

    [
      uuid(24be5a30-edfe-11d2-b933-00104b365c9f),
      odl,
      dual,
      oleautomation,
      hidden
    ]
    interface IWshShell2 : IWshShell {
        [id(0x0bb8)]
        HRESULT LogEvent(
            [in] VARIANT* Type,
            [in] BSTR Message,
578
            [in, defaultvalue("")] BSTR Target,
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610
            [out, retval] VARIANT_BOOL* out_Success);

        [id(0x0bc2)]
        HRESULT AppActivate(
            [in] VARIANT* App,
            [in, optional] VARIANT* Wait,
            [out, retval] VARIANT_BOOL* out_Success);

        [id(0x0bc3)]
        HRESULT SendKeys(
            [in] BSTR Keys,
            [in, optional] VARIANT* Wait);
    };

    [
        uuid(41904400-be18-11d3-a28b-00104bd35090),
        odl,
        dual,
        oleautomation
    ]
    interface IWshShell3 : IWshShell2 {
        [id(0x0bc4)]
        HRESULT Exec(
            [in] BSTR Command,
            [out, retval] IWshExec** out_Exec);

        [id(0x0bc5), propget]
        HRESULT CurrentDirectory([out, retval] BSTR* out_Directory);

        [id(0x0bc5), propput]
        HRESULT CurrentDirectory([in] BSTR out_Directory);
    };
Jacek Caban's avatar
Jacek Caban committed
611 612 613 614 615 616 617 618 619 620 621 622 623 624

    [
        uuid(24be5a31-edfe-11d2-b933-00104b365c9f),
        odl,
        dual,
        oleautomation
    ]
    interface IWshNetwork2 : IDispatch {
        [id(0x60020000), propget]
        HRESULT UserDomain([out, retval] BSTR *out_UserDomain);
    }

    [
        helpstring("Windows Script Host Shell Object"),
625 626 627 628
        uuid(f935dc22-1cf0-11d0-adb9-00c04fd58a0b),
        threading(apartment),
        progid("WScript.Shell.1"),
        vi_progid("WScript.Shell")
Jacek Caban's avatar
Jacek Caban committed
629 630 631 632 633 634 635
    ]
    coclass IWshShell_Class {
        [default] interface IWshShell3;
    }

    [
        helpstring("Windows Script Host Shell Object"),
636 637 638 639
        uuid(72c24dd5-d70a-438b-8a42-98424b88afb8),
        threading(apartment),
        progid("WScript.Shell.1"),
        vi_progid("WScript.Shell")
Jacek Caban's avatar
Jacek Caban committed
640 641 642 643 644 645 646
    ]
    coclass WshShell {
        [default] interface IWshShell3;
    }

    [
        helpstring("Windows Script Host Network Object"),
647 648 649 650
        uuid(f935dc26-1cf0-11d0-adb9-00c04fd58a0b),
        threading(apartment),
        progid("WScript.Network.1"),
        vi_progid("WScript.Network")
Jacek Caban's avatar
Jacek Caban committed
651 652 653 654 655 656 657
    ]
    coclass IWshNetwork_Class {
        [default] interface IWshNetwork2;
    }

    [
        helpstring("Windows Script Host Network Object"),
658 659 660 661
        uuid(093ff999-1ea0-4079-9525-9614c3504b74),
        threading(apartment),
        progid("WScript.Network.1"),
        vi_progid("WScript.Network")
Jacek Caban's avatar
Jacek Caban committed
662 663 664 665
    ]
    coclass WshNetwork {
        [default] interface IWshNetwork2;
    }
666 667 668 669 670 671 672 673

    [
        uuid(08fed191-be19-11d3-a28b-00104bd35090),
        threading(apartment)
    ]
    coclass WshExec {
        [default] interface IWshExec;
    }
Jacek Caban's avatar
Jacek Caban committed
674
}